outline-ss-server icon indicating copy to clipboard operation
outline-ss-server copied to clipboard

Add websocket tunneling support

Open ha-D opened this issue 3 years ago • 0 comments

Three main things here:

  • websocket/websocket.go: Takes the websocket.Conn from the gorilla/websocket package and wraps it in a struct that implements the onet.DuplexConn interface. With this, we can treat a websocket connection as a normal streaming protocol similar to TCP.

  • websocket.go: Implements RunWebsocketServer which starts a websocket server on 443. The websocket server expects to see a port number in the URL path of connections, and it uses that to multiplex the connection to their respective TCPServices.

  • client/websocket.go: Implements client.NewWebsocketClient which is similar to client.NewClient except that instead of a plain TCP connection, it sends the Shadowsocks content over a websocket connection.

--

This is only TCP for now, however a similar thing can be done for UDP in a separate PR.

ha-D avatar Nov 01 '22 22:11 ha-D