V
V
Vitaly Stolyarov2016-02-18 13:36:41
open server
Vitaly Stolyarov, 2016-02-18 13:36:41

How to setup WebSocket on local machine?

I used more than one ( 1 , 2 ) ready-made implementation, in theory everything should work and there are no errors in the code itself. In addition, it connects normally to echo.websocket.org, which means there is a problem with the server side. Namely, in the following:
when trying to connect to my socket, it knocks out

WebSocket connection to 'ws://localhost:8000/server.php' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

perhaps all because of the port that no one has opened, which OpenServer does not allow, after editing httpd.conf, the values ​​\u200b\u200bare still changed to the previous ones
and when trying to connect to port 80
WebSocket connection to 'ws://localhost/server.php' failed: Error during WebSocket handshake: Unexpected response code: 200

as much as I managed to google, everything says that nothing prevents you from connecting to port 80, but in the end it just returns code 200
and, according to the second example, writes to the logs
socket_bind() failed: An attempt was made to access a socket in a way forbidden by its access permissions.
socket_listen() failed: An invalid argument was supplied.
Server started on 127.0.0.1 : 80

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question