WebSocket class

Hello

I need a WebSocketServer class, that class should just encode/decode messages and be able to make handshakes.
I guess it should be just a subclass of ServerSocket/TCPSocket. I need it to create a websocket SERVER, not a client.

Who can help me? Work shouldn’t be free ofcourse!

Thank you

Perhaps Write a Webserver in 100 Lines of Code or Less might be a place to start?

Thanks for the answer, but that’s an ‘ordanairy’ HTTP server. I need a WebSocketServer. That’s a subprotocol of HTTP.
See Wikipedia article about it: https://en.wikipedia.org/wiki/WebSocket

[quote=236903:@Mathias Maes]Thanks for the answer, but that’s an ‘ordanairy’ HTTP server. I need a WebSocketServer. That’s a subprotocol of HTTP.
See Wikipedia article about it: https://en.wikipedia.org/wiki/WebSocket[/quote]
Fwiw, if you’re writing your own, you’ll need an http server as well. Web socket connections are negotiated from plain old http.

The question would be: why do you need it?

Next question, why do you use Xojo for that? For other tools you easily find implementations…

Well, only partially. The only moment when HTTP is used is when the handshake is done. So only 1 kind of HTTP request needs to be accepted, after that, it’s just a protocol over TCP. But I’m not that good at XOR logic adn those bytes and all. IT’s something like this I need: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_server But that is C#.

[quote=236920:@Christian Schmitz]The question would be: why do you need it?

Next question, why do you use Xojo for that? For other tools you easily find implementations…[/quote]
I would like to use it as a small gameserver for Javascript games. The reason I need it in Xojo is because I want the same codebase for all my tools concerning this project (except the JavaScript ofcours)

I found some code about a year ago that does this. I’m travelling back to France today, be back around midnight , so I can pass it on tomorrow morning if you don’t get any joy in the meantime.

Great! Thank you!!