webssh2 icon indicating copy to clipboard operation
webssh2 copied to clipboard

CHORE: Replaces socket.io with native websockets

Open billchurch opened this issue 3 years ago • 3 comments

I believe socket.io has outlived its usefulness for this project and I think the bulk of the browsers used today support websockets natively.

I've created a new branch ws-experiment to test that change which I think we'll target as 0.5.0 for now.

In addition to this, I intend to drop support for node 6, and potentially even node 8 and make node 10 the minimum supported version going forward. It's become increasingly difficult to keep packages up to date and maintain support for those older versions of node.

billchurch avatar May 13 '21 09:05 billchurch

Hello, @billchurch, I'm interested in testing or possibly developing the native websockets version, but I couldn't find the branch you've mentioned. If it's not too much to ask for, do you still have it somewhere?

diogenes1oliveira avatar May 23 '22 23:05 diogenes1oliveira

I did kill it as it was a little more involved than I was hoping at the time.

However, I would like to revisit it but need a little more planning around it as Socket.Io does abstract a lot of things for us.

Thoughts?

billchurch avatar May 23 '22 23:05 billchurch

@billchurch sorry for the late response, specially compared to the promptness of yours...

Yeah, I was checking it out a little more and you'd need to come up with some encoding of messages to replace the socket.io events/channels. It wouldn't be too difficult, but maybe it's not worth it. Maybe just expose an option to set "transports:["websocket"] in the socket.io setting, excluding the initial long polling requests?

My motivation was mostly to transport some binary data as well through the UI, but I came up with a simple Go command to encode the streaming command input/output as base64.

diogenes1oliveira avatar Jun 03 '22 22:06 diogenes1oliveira