ghedipunk / PHP-Websockets

A Websockets server written in PHP.
BSD 3-Clause "New" or "Revised" License
913 stars 375 forks source link

Cannot telnet to socketserver #52

Closed kurbar closed 8 years ago

kurbar commented 8 years ago

Hi,

I have a question that is it possible for me to telnet to the newly started socket server to be able to test it from my terminal?

I currently set it up to listen on 127.0.0.1:21001 and when I try to telnet to it from another terminal it fails:

$ telnet 127.0.0.1:21001
telnet: 127.0.0.1:21001: Name or service not known
127.0.0.1:21001: Unknown host
$ telnet ws://127.0.0.1:21001
telnet: ws://127.0.0.1:21001: Name or service not known

Is it even possible to use telnet for WebSockets?

Thank-you in advance.

kurbar commented 8 years ago

Very embarrasing of me. I forgot to open the port :)

Though now I'm behind another issue. I started up the WebSockets server and took the client JS code from this repo. When I load the page it starts connecting but then idles for around 4 minutes when finally timing out

WebSocket connection to 'ws://127.0.0.1:21001/' failed: WebSocket opening handshake timed out
ghedipunk commented 8 years ago

Closing old issue (I honestly feel bad for not at least responding to this).

For the record, telnet can work with WebSocket connections, but involves writing binary data in the handshake, so is very difficult to do "by hand."

Suggestion: Use (or write) a client that handles the WebSocket protocol.