Closed Zibri closed 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
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.
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.
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
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
I was just suggesting a simple feature for wstunnel... so there is not need for other utilities like nginx
Ha, understood.
Sadly, this feature will not be part of wstunnel. The project aims to stay simple, advanced features require a real reverse proxy
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.