rapiz1 / rathole

A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.
Apache License 2.0
8.82k stars 441 forks source link

Is it possible to use websocket for transport and noise for encryption? #293

Closed fernvenue closed 9 months ago

fernvenue commented 9 months ago

Is it possible to use websocket for transport and noise for encryption?

Originally posted by @fernvenue in https://github.com/rapiz1/rathole/issues/290#issuecomment-1742034945

rapiz1 commented 9 months ago

No. You have to change the code and somehow stack the transport layer, which I think should be doable. But I wonder why not websocket with tls?

On Sun, Oct 1, 2023, 18:58 fernvenue @.***> wrote:

Is it possible to use websocket for transport and noise for encryption?

Originally posted by @fernvenue https://github.com/fernvenue in #290 (comment) https://github.com/rapiz1/rathole/pull/290#issuecomment-1742034945

— Reply to this email directly, view it on GitHub https://github.com/rapiz1/rathole/issues/293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZMOZIPYJGVLUFZEMVACRLX5FED5ANCNFSM6AAAAAA5OHTBCY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

fernvenue commented 9 months ago

Hi @rapiz1, I just discussed this with @rucciva in https://github.com/rapiz1/rathole/pull/290.

At start, I thought we might can use websocket to get better performance, but TLS is a little bit complex sometimes than noise, so I wondering that can we use websocket with noise :)

Then @rucciva suggests that I should do a benchmark, here I did, and the answer is that we should keep using TCP as protocol if we want best performance for both bandwidth and latency.

So, if anyone else have the same question, check the benchmark test, and I'm gonna close this issue for now.