GithubHelp home page GithubHelp logo

diegohce / nexer Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 0.0 53 KB

Content based network multiplexer or redirector made with love and Go

License: GNU Affero General Public License v3.0

Go 98.86% Shell 1.14%
go golang network networking tool tools network-multiplexer redirects tunnel connection-pool

nexer's Introduction

nexer

An easily extensible and content based, network multiplexer.

Usage

Nexer core arguments

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 tunnels

Available tunnel types:
	tee
	connectionpool
	direct
	echo
	pip
	apt
	apt-experimental
	url

tee tunnel

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

connectionpool

Connection pooling between nexer and -dest

Usage of connectionpool:
  -dest string
    	Destination address:port
  -pool-size int
    	Connection pool size (default 1)

echo tunnel

Echo has no arguments. Implements an echo server.

direct tunnel

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)

apt / apt-experimental tunnel

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

To use apt-get with the tunnel

# apt-get -o "Acquire::http::proxy=http://yourserver:3142" update

or

# apt-get -o "Acquire::http::proxy=http://yourserver:3142" install <package name>

pip tunnel

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")

Create the pip tunnel

To create a tunnel simply run:

# ./nexer -bind :3143 -tunnel pip

Installing python packages using the pip tunnel

pip install --index-url "http://yourserver:3143/simple/" <python-package-name>

or

pip install --index-url "http://yourserver:3143/simple/" -r requirements.txt

Searching for packages using the pip tunnel

pip search --index http://yourserver:3143/pypi <python-package-name>

url tunnel

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

Extending nexer (new tunnel dev)

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.

Building

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.