Docker
You can also use Docker to run the LocalXpose CLI and GUI locally on any machine.
Check out the available commands here.
Usage
docker run -it -e ACCESS_TOKEN=YOUR_TOKEN_HERE \
localxpose/localxpose:latest <COMMAND> <SUBCOMMAND> <FLAG>
Run http tunnel
docker run -it -e ACCESS_TOKEN=YOUR_TOKEN_HERE \
localxpose/localxpose:latest tunnel http
By default, Docker containers run on their own isolated network, and each container's localhost
points to itself. This means that the usual method of forwarding via --to localhost:8080
will not work within Docker.
There are two approaches you may use to forward from Docker to your host network.
The first approach is to use the host IP address directly (for example 192.168.1.101
) then do docker run -it localxpose/localxpose:latest tunnel http --to 192.168.1.101:8080
.
Another approach is to run the LocalXpose Docker container on your host network by adding --net host
to your Docker run command. In this scenario the full command will be:
docker run --net host -it -e ACCESS_TOKEN=YOUR_TOKEN_HERE \
localxpose/localxpose:latest tunnel http --to localhost:8080
Run multiple tunnels from config.yaml
First create your config.yaml file, then mount it inside a LocalXpose Docker container.
For example, if we have the following config.yaml file:
dev:
type: http
to: 192.168.100.2:8080
subdomain: dockerdo
We would mount this config file into the LocalXpose container by using the -v
flag:
docker run -it -e ACCESS_TOKEN=YOUR_TOKEN_HERE \
-v /home/username/config.yaml:/config.yaml \
localxpose/localxpose:latest tunnel config -f /config.yaml