rathole icon indicating copy to clipboard operation
rathole copied to clipboard

wish to support websocket transport

Open aa51513 opened this issue 3 years ago • 1 comments

websocket has been widely used and supported by attack prevention providers such as cloudflare

And I noticed that Rust already supports Websocket dependencies and can be used directly

Could you consider adding support for the websocket protocol in the transport type?

aa51513 avatar Feb 17 '22 04:02 aa51513

Websocket seems to work just fine for me (TCP)

9p4 avatar Mar 03 '22 01:03 9p4

Working for me as well

emilyastranova avatar Nov 27 '22 00:11 emilyastranova

I have the same request, and I'm confused by the comments. This is a request for WebSocket transport, not services, and is not implemented. It cannot be "working for you".

remram44 avatar Aug 17 '23 03:08 remram44

Would be awesome if rathole support this. My use case is to expose a port of an internal service running inside kubernetes to another kubernetes cluster. Being able to expose rathole server through ingress would prevent opening another tcp port and reducing attack surface. I don't mind the reduced performance since its not used in the hot path of user traffic.

rucciva avatar Aug 26 '23 01:08 rucciva

I have the same request, and I'm confused by the comments. This is a request for WebSocket transport, not services, and is not implemented. It cannot be "working for you".

Ahh I misunderstood, this makes more sense.

emilyastranova avatar Aug 27 '23 02:08 emilyastranova

Hi @rapiz1 , will PR accepted for this? I have no rust background but i'm willing to learn. I've read about tokio-tungstenite or fastwebsocket as possible library, wdyt?

rucciva avatar Aug 28 '23 12:08 rucciva

i tried to make a websocket transport using tokio-tungstenite here

~~It passes the tcp test but unfortunately the udp test stuck. i'm not sure why. maybe anyone here got a clue?~~

PR opened #290

rucciva avatar Sep 25 '23 10:09 rucciva

Hi @aa51513 & @remram44 , would you care to try it?

there is a downloadable executable in here and sample config in:

i've tried running iperf3 through rathole + caddy https and it seems to be faster than ssh port forward (almost 2x transfer rate). But surprisingly, it is sometimes better than rathole tcp, which is odd.

rucciva avatar Sep 26 '23 08:09 rucciva