Skip to content Skip to sidebar Skip to footer

Why Can't I Connect To This Websocket?

Having great difficulty getting a response, even a reassuring error response, after attempts to connect to Coinfloor's websocket API. Docs here: https://github.com/coinfloor/API/bl

Solution 1:

Because sockets and WebSocket are completely different things. AF_INET/SOCK_STREAM socket is a facility that uses TCP to communicate to the remote peer. On the other hand, WebSocket is a binary protocol that

  1. Works on the top of TCP or TLS.

  2. Has to perform HTTP handshake before data exchange.

Since WebSocket is a rather complex protocol (see the standard), your best course of action is to find a WebSocket library and use it instead of trying to implement the protocol starting from TCP.

Post a Comment for "Why Can't I Connect To This Websocket?"