WebSocket server in Xojo

i found this little example of how to write a websocket server in c#

is there anything to create a websocket server in xojo?

come this!

I don’t know if anyone has made one yet, but I think Xojo has everything needed to do it. The ServerSocket class is analogous to the TcpListener class used in the C# example, and the TCPSocket class is analogous to the TcpClient.

Aloe Express included a websocket server implementation. But I don’t know where to find the Aloe Express code anymore.

Here is a version with my modifications. Tim didn’t like my approach so didn’t incorporate them, but the basic project is his. I offer no support for this. Edit: I don’t know if there had been any updates to the main project after I branched.

Here is my WebSocket project. It needs to be modified to work as a server, and as I never ended up using it in my projects, I can’t vouch for bugs.

Hi, you might want to take a look at this:
https://github.com/gregorplop/fswebapi

Not for the particular application (fswebapi), but for the underlying library (ipservercore).
It is a basic HTTP server implementation based on the ServerSocket/SSLSocket.
Currently it doesn’t support SSL, but I was playing around with it today and it’s coming soon, maybe as early as tomorrow.

You’ll need to heavily modify it of course, but it might not be a bad foundation for your app.

Yes, I have. I made it to assist communication between Xojo code and an HTMLViewer.

I wrote one based on Kem’s class a few years back. It took some doing to modify it, but it worked well. In the end, though, I decided to go a different route and use XmlHttpRequests for a variety of reasons.

Tim,
In your websocket assisted application, you used a Xojo based websocket server to stream / send data to an HTML viewer in a Xojo web app?

Yes, for two-way communication. There was one problem which was that on Windows, putting the app to sleep closed the websocket. So I don’t use that anymore.