erebe / wstunnel

Tunnel all your traffic over Websocket or HTTP2 - Bypass firewalls/DPI - Static binary available
Other
3.22k stars 290 forks source link

missing option? #85

Closed Zibri closed 2 years ago

Zibri commented 2 years ago

MYSERVER BEHIND NAT---> wsTunnelServer running on public server <--- MY CLIENT BEHIND NAT

to allow any client to connect to "myserver" through a public server running wstunnel

This option is missing in most softwares. And would allow for example two devices connected using a phone network (3g/4g/5g) to connect to each other services.

erebe commented 2 years ago

Take a look at this issue, it is kind a of the same answer in your case. https://github.com/erebe/wstunnel/issues/84

You need to combine wstunnel and ssh -R

Zibri commented 2 years ago

hmm no.. that does not work. I explain better:

I have a server on a local machine running on PORT XXX I wish that to be reachable by "remotemachine" port 80

and "remote machine" can ONLY use port 80.

Zibri commented 2 years ago

it's a feature missing from wstunnel.

what wstunnel should do is to serve a websocked AND html on the same port.. as "ttyd" does. in this way it would be easy to map a firewalled port 80 to the same port wstunnel is running.

Zibri commented 2 years ago

so, let's say:

on the public reachable server: wstunnel --server ws://0.0.0.0:80

on the local machine (where there is a webserver/service running on port 8123): wstunnel --client 8123 ws://publicserveraddress:80

on any other computer on internet: browsing to http://publicserveraddress will connect to the webserver/service running on the local machine on port 8123

erebe commented 2 years ago

Hello, If you want to share the same port to multiplex services, you can use a dedicated reverse proxy for that (i.e: nginx) You can match on the http upgrade path of websocket connection to proxy pass the request to wstunnel and let other request your webserver.

Take a look at this issue to get hint regarding how to do that https://github.com/erebe/wstunnel/issues/14

Zibri commented 2 years ago

I was just suggesting a simple feature for wstunnel... so there is not need for other utilities like nginx

erebe commented 2 years ago

Ha, understood.

Sadly, this feature will not be part of wstunnel. The project aims to stay simple, advanced features require a real reverse proxy