Answer the question
In order to leave comments, you need to log in
How to run websocket on centos7 server?
Hi all!
I ran into a problem, on the project I raised websockets using Ratchet, took port 8888, everything is fine on the local machine, started the daemon and javascript calmly accesses this port via ws://site.ru/online.
But when I uploaded everything to the server (Centos 7), then in js I get the following error:
WebSocket connection to 'ws://site.ru/online' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
Answer the question
In order to leave comments, you need to log in
I found a solution, in general, do not use the ratchet example on github https://github.com/ratchetphp/Ratchet,
There is another example of raising a websocket on the off site
$server = IoServer::factory(
new HttpServer(
new WsServer(
new $server
)
),
$port
);
$server->run();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question