An easily extensible and content based, network multiplexer.
Usage of nexer:
-bind string
Bind [address]:port
-proto string
Protocol [tcp/udp] (default "tcp")
-tunnel string
Tunnel type (see --tunnels) (default "echo")
-tunnels
Tunnels list
-version
Shows nexer current version
Available tunnel types:
tee
connectionpool
direct
echo
pip
apt
apt-experimental
url
Sends the same request to both -main
and -forward-to
hosts. Responses from -forward-to
host are logged into -logfile
or to standard output.
Usage of tee:
-forward-to string
Where to forward requests to
-logfile string
Where to log the forwarded responses (default "(stdout)")
-main string
Real request/endpoint destination
Connection pooling between nexer and -dest
Usage of connectionpool:
-dest string
Destination address:port
-pool-size int
Connection pool size (default 1)
Echo has no arguments. Implements an echo server.
Direct tunnel redirection
Usage of direct:
-dest string
Destination address:port
-proto string
Protocol [tcp/udp] (default "tcp")
-write-delay int
Write delay in seconds (default 0)
The apt-experimental tunnel is expected to be faster and more reliable than the plain apt tunnel.
Usage of apt:
-log-requests
Show http requests (default false)
To create the tunnel run:
# ./nexer -bind :3142 -tunnel apt
or
# ./nexer -bind :3142 -tunnel apt-experimental
# apt-get -o "Acquire::http::proxy=http://yourserver:3142" update
or
# apt-get -o "Acquire::http::proxy=http://yourserver:3142" install <package name>
Tunnel to pip service (python packages index)
Usage of pip:
-dest string
Destination pip servername (will use https port 443 always!) (default "pypi.python.org")
To create a tunnel simply run:
# ./nexer -bind :3143 -tunnel pip
pip install --index-url "http://yourserver:3143/simple/" <python-package-name>
or
pip install --index-url "http://yourserver:3143/simple/" -r requirements.txt
pip search --index http://yourserver:3143/pypi <python-package-name>
Usage of url:
-debug string
Destination address:port
-prod string
Destination address:port
Redirects to -prod. If debug=1
is present in the querystring, redirects to -debug
The easiest way to commence is to look at the echo tunnel and the direct tunnel as an example.
Also check the import
statement in nexer.go
where tunnels must be imported to be available.
After setting Go environment values
(goenv.sh might help),
go to src
directory and run from the command line:
go build -tags all nexer.go version.go