MSNLD / Mono-Project

This is the source of truth for all MSNLD projects.
0 stars 0 forks source link

WebSocket (WSS) access #1

Open realJoshByrnes opened 12 months ago

realJoshByrnes commented 12 months ago

For us to create a webchat, we need to (re-)introduce WebSockets.

I propose that for now we just use a simple forwarding service, once we are a little further along, we can customize to add WebIRC support, or add it directly to the IRC7 server.

To clarify: Client should connect to a wss:// (WebSocket Secure) URL over HTTPS on port 443 and be forwarded to TCP port 6667. To prevent potential network sniffing, the forwarded address should only be localhost on either IPv4 or IPv6.

This is a suggested temporary measure which will assist with creating a webchat. Connection methods should be listed in the Wiki

realJoshByrnes commented 12 months ago

It may be worthwhile (re-)introducing SSL connections on the chat server (port 6697), and considering if WebSocket over HTTPS (non-secure) should be added.

realJoshByrnes commented 12 months ago

@jyonxo Are you planning on implementing WS support (non-HTTPS?)

I feel like it's a good idea if it's easy with the same stack, even if Mono doesn't support it.

realJoshByrnes commented 12 months ago

Current servers (in testing) wss://dirws.mono.chat:8443/ wss://ircws.mono.chat:8443/

jyonxo commented 12 months ago

As @realJoshByrnes said in order to speed up the WebChat development we have solved this for the time being using a Websocket <-> TCP Proxy. We can look to putting Websockets directly into irc7 at a later stage.

@elvenharps if you want we can either close this out or scrub it and put it back into the Backlog

realJoshByrnes commented 12 months ago

I think we should l move this to testing rather than just closing it.

Just in case we find any issues with authentication etc.

realJoshByrnes commented 12 months ago
00000000: 4552 524f 5220 3a43 6c6f 7369 6e67 204c  ERROR :Closing L
00000001: 696e 6b3a 204a 445b 3a3a 6666 6666 3a31  ink: JD[::ffff:1
00000002: 3237 2e30 2e30 2e31 5d20 3031 3120 2850  27.0.0.1] 011 (P
00000003: 696e 6720 7469 6d65 6f75 7429 0d0a       ing timeout)..

Although I'm seeing the IRC message stating that I am being disconnected, it doesn't appear that I am actually disconnected at the WebSocket end. This could be one of a few things, but further testing is required.

  1. Chat Server is not closing TCP socket after Ping Timeout.
  2. WebSockify is not disconnecting WebSocket after TCP socket is closed.
  3. Client is not handling disconnects properly.

I suspect 2 is the case, but I have not yet ruled out any of the above.