Browse Source

Update websocket connection URL

pull/54/head
Amir Sanni 5 years ago
parent
commit
7e4edb4a81
  1. 4
      js/comm.js
  2. 4
      ws/bin/server.php

4
js/comm.js

@ -21,11 +21,11 @@ let wsChat; @@ -21,11 +21,11 @@ let wsChat;
const room = getRoom();
if(location.protocol === 'http:'){
wsChat = new WebSocket("ws://1410inc.xyz/ws/comm");
wsChat = new WebSocket("ws://localhost:8080/comm");
}
else{
wsChat = new WebSocket("wss://1410inc.xyz/wss/comm");
wsChat = new WebSocket("wss://localhost:8080/comm");
}
window.addEventListener('load', function(){

4
ws/bin/server.php

@ -13,10 +13,10 @@ use Amir\Comm; @@ -13,10 +13,10 @@ use Amir\Comm;
use Ratchet\App;
//set an array of origins allowed to connect to this server
$allowed_origins = ['localhost', '127.0.0.1', '1410inc.xyz', 'www.1410inc.xyz'];
$allowed_origins = ['localhost', '127.0.0.1'];
// Run the server application through the WebSocket protocol on port 8080
$app = new App('1410inc.xyz', 8080, '0.0.0.0');//App(hostname, port, 'whoCanConnectIP', '')
$app = new App('localhost', 8080, '0.0.0.0');//App(hostname, port, 'whoCanConnectIP', '')
//create socket routes
//route(uri, classInstance, arrOfAllowedOrigins)

Loading…
Cancel
Save