Layover is a TCP & UDP socket proxy intended to help the following scenarios:
- Relaying a port of a non containerized process into a container based network i.e traefik ❤️
- Debug and log a whily networked application
For a very quick deployment please do the following
-
set your proxy port variable 'LAYOVER_PROXYPORT' in the docker-compose.yml
-
if you are using traefik, modify the host for 'traefik.http.routers.layover.rule', for more information go here
-
run the following
$ docker-compose up -d --force-recreate --build layover
While installation is not recommened for proxying over containers, it is available.
Binary releases are available in the github releases page found here
golang 1.14+ is required set GO111MODULE=on
$ go get -u github.com/kjcodeacct/layover
If you would like to manually build binaries available in the releases page, run the following.
$ make binaries
If you would like to build your own release of layover, please see the Dockerfile for a local build and run the following for a successful image build.
$ make docker
If you want to view steps used by <drone.io> for automated builds please view .drone.yml
$ export LAYOVER_SERVEPORT=8081
$ export LAYOVER_PROXYPORT=8080
$ layover proxy
Docker Run
$ docker run -e LAYOVER_SERVEPORT=8081 -e LAYOVER_SERVEHOST=0.0.0.0 -e LAYOVER_PROXYHOST=172.17.0.1 -e LAYOVER_PROXYPORT=8080 --publish 8081:8081 kjcodeacct/layover
Docker Compose
$ docker-compose up layover
Below is a complete list of configuration for more complex needs
Below are the available flags and their configuration. Flags can be provided either by the CLI flag or via ENV variables
Flag | Env Variable | Type | Description | Default |
---|---|---|---|---|
proxyhost | LAYOVER_PROXYHOST |
string | the host layover is proxying from, unless specified to a different host machine uses the default | 0.0.0.0 |
proxyport | LAYOVER_PROXYPORT |
int | the port layover is proxying FROM, this is typically the port not in the container system | 8081 |
serveport | LAYOVER_SERVEPORT |
int | the port layover is proxying TO and is serving, if running in a container typically does not need to be specified | 8080 |
servehost | LAYOVER_SERVEHOST |
string | the host layover is proxying TO and is serving, if running in a container typically this needs to be specified to '172.17.0.1' | 127.0.0.1 |
Docker API 1.40+
Golang version 1.14+
Portions of TCP & UDP network handling was used from: Traefik https://github.com/containous/traefik