kishor10d/CodeIgniter-Ratchet-Websocket

Connection Localhost

shayanali995 opened this issue · 4 comments

Hello,

I am having connection issue on localhost server i am using 8080 port and console is showing this error

WebSocket connection to 'ws://192.168.0.105:8080/' failed: Error during WebSocket handshake: Unexpected response code: 302

Thanks,

I think you didn't start the websocket server. You need to start it.

WebSocket server and your apache server are two different things. You have apache server running on 8080 port, but in repository, websocket server running on port 2000.

I have started bin/server.php from command console but nothing works can you please guide me how to check port of WebSocket

$server = IoServer::factory(new HttpServer(new WsServer(new Chat)), 2000);

Check this line in server.php, you need to keep the port number 2000.

define("BROADCAST_URL", "192.168.0.6");
define("BROADCAST_PORT", "2000");

Also check above two lines in application/config/constants.php file. Check the port number is same 2000. If you are using 8080 then please change port number at both ends. Also check your IP address. Replace ip 192.168.0.6 with yours.

Okay thanks a bunch !