add --sub-host option

This commit is contained in:
whitecolor
2017-06-07 15:05:05 +05:00
parent 48475a404b
commit 5bc44fb901
5 changed files with 104 additions and 21 deletions
+9 -5
View File
@@ -6,7 +6,7 @@ localtunnel exposes your localhost to the world for easy testing and sharing! No
This repo is the server component. If you are just looking for the CLI localtunnel app, see (https://github.com/localtunnel/localtunnel).
## overview ##
## overview
The default localtunnel client connects to the `localtunnel.me` server. You can, however, easily set up and run your own server. In order to run your own localtunnel server you must ensure that your server can meet the following requirements:
@@ -15,7 +15,7 @@ The default localtunnel client connects to the `localtunnel.me` server. You can,
The above are important as the client will ask the server for a subdomain under a particular domain. The server will listen on any OS-assigned TCP port for client connections.
#### setup
## setup
```shell
# pick a place where the files will live
@@ -29,7 +29,7 @@ bin/server --port 1234
The localtunnel server is now running and waiting for client requests on port 1234. You will most likely want to set up a reverse proxy to listen on port 80 (or start localtunnel on port 80 directly).
#### use your server
## use your server
You can now use your domain with the `--host` flag for the `lt` client.
@@ -41,7 +41,9 @@ You will be assigned a URL similar to `qdci.sub.example.com:1234`.
If your server is acting as a reverse proxy (i.e. nginx) and is able to listen on port 80, then you do not need the `:1234` part of the hostname for the `lt` client.
## Deploy
Not that to use sub-hosts you should pass `--sub-host` option to server
## deploy
You can deploy your own localtunnel server using the prebuilt docker image.
@@ -54,5 +56,7 @@ docker run -d \
--restart always \
--name localtunnel \
--net host \
defunctzombie/localtunnel-server:latest --port 3000
defunctzombie/localtunnel-server:latest --port 3000 --sub-host sub
```