Skip to content Skip to sidebar Skip to footer

Html5 Web Sockets - How To Communicate With Them?

I've tested many socket examples and communication between them was pretty simple: socket is opened and stays open until you close it and no information is being sent except the on

Solution 1:

I've tested many web socket examples ....

From what you describe you did not use "web sockets" but simply "sockets", e.g. direct TCP/IP. WebSockets (e.g. what you call "HTML web sockets") are different: they are used to create something socket like over an established HTTP connection. Therefore you see the HTTP query with the "Upgrade: websocket" header, with the "Sec-WebSocket-Key" etc.

After establishing the connection (server sends response with code 101) the WebSocket connection has their own framing and scrambling of the data, so you cannot just use it with the normal socket tools.

See https://www.rfc-editor.org/rfc/rfc6455 for the specification and use "WebSockets" as the keyword if you look for more documentation, usage...

Post a Comment for "Html5 Web Sockets - How To Communicate With Them?"