kaichaosun / rlt

Localtunnel implementation in Rust, expose local API to the public.
MIT License
87 stars 11 forks source link

Setting up the server on a subdomain #25

Closed mfasold closed 1 year ago

mfasold commented 1 year ago

Hi! I am trying to set up a localtunnel server with rlt, but unfortunately I cannot get it to work.

First, I successfully created a local tunnel to the public server localtunnel.me to check my local client works.

Next I wanted to set up a server myself, starting with the simplest configuration (HTTP-only on port 80, no reverse proxy). So I pointed my DNS A-records to the server IP (*.sub.example.com and sub.example.com) and run localtunnel server --domain sub.example.com --port 80 --proxy-port 3001. I find that the localtunnel is listening on those ports and also locally responds (e.g. with curl localhost:80/test).

However, I cannot connect with the client (e.g. localtunnel client --host http://sub.example.com --subdomain test --port 8008) - the connection is refused. Am I missing any important configuration steps?

To exclude the possibility that some server / DNA configuration is wrong, I wanted to run the (nodejs) localtunnel server using the Docker deployment. There I get Error: error decoding response body: invalid type: integer404, expected struct ProxyResponse at line 1 column 3. I somehow suspect that the node server can be reached from the outside, but does not correctly react on the host name.

kaichaosun commented 1 year ago

You need a reverse proxy to point *.sub.example.com to port 3001, and sub.example.com to 80

mfasold commented 1 year ago

Thank you, it works that way!