Skip to content

A REALLY fast proxy manager, battle tested with 200K concurrent connections on mid-sized (8 core + 16gb) hardware.

License

Notifications You must be signed in to change notification settings

reneManqueros/moxxiproxy

Repository files navigation

Moxxi Proxy

A REALLY fast proxy manager, battle tested with 200K concurrent connections on mid-sized (8 core + 16gb) hardware.

Features

  • Maps to network interfaces
  • Low resource footprint
  • Basic Authentication
  • Client whitelist
  • Random load balance selection
  • Session stickiness
  • Group backends by regions
  • Logs
  • IPv6

Installation

Download binary:

wget https://github.com/reneManqueros/moxxiproxy/releases/download/v1.4.1/moxxiproxy_1.4.1_Linux_x86_64.tar.gz && tar xf moxxiproxy_1.4.1_Linux_x86_64.tar.gz 

Or download source and compile:

git clone https://github.com/reneManqueros/moxxiproxy.git && cd moxxiproxy && make build

Usage

./moxxiproxy run

Parameters

Flag Use Default
address Set the listen address 0.0.0.0:1989
exitnodes Path to config file ./exitNodes.yml
auth user/password for authentication
usersfile Path to list of authenticated users, requires auth to be empty
whitelist IP's to allow to use, allows all if blank
timeout default timeout seconds for backen connection, 0 for infinite 0
upstream set upstream mode, uses upstream instead of interface on exitNodes file
authupstream sends credentials to the upstream, requires upstream to be enabled
prettylogs display colorful logs, if false display them as json false
loglevel Minimum log level to print: trace, debug, info, warn, error, fatal info
promaddress Listen address for prometheus 0.0.0.0:2122
metrics How to handle metrics, accepted values: prometheus, stdout or empty for nothing; stdout requires loglevel=trace

ExitNodes file

The list of backends (exitnodes) to use

File format

  # [required if not in upstream mode] interface used as the exit IP, only works when not in upstream
  interface: 0.0.0.0

  # [optional] passed as part of authentication to group exit nodes
  region: us

  # [optional] passed as part of authentication to explicitly use this exit node
  instance_id: us.00

  # [required if in upstream mode] IP:port of upstream proxy
  upstream: 1.2.3.4:1080

Basic example:

Server with 4 interfaces, no grouping/targetting specific nodes

- interface: 0.0.0.1
- interface: 0.0.0.2
- interface: 0.0.0.3
- interface: 0.0.0.4

Service ran as:

moxxiproxy run 

Basic upstream example :

Works as load balancer for remote proxies

- upstream: 0.0.0.1:1080
- upstream: 0.0.0.2:1080
- upstream: 0.0.0.3:1080
- upstream: 0.0.0.4:1080

Service ran as:

moxxiproxy run --upstream=true

region example :

uses regions to group proxies. Example uses upstream but the same can be achieved with interface.

- upstream: 0.0.0.1:1080
  region: us
- upstream: 0.0.0.2:1080
  region: us
- upstream: 0.0.0.3:1080
  region: ca
- upstream: 0.0.0.4:1080
  region: ca

Service ran as [set any value as the username]:

moxxiproxy run --upstream=true --auth=testuser:

Consumed as:

curl -kxhttp://testuser_region-us:@0.0.0.0:1989 http://page.com

instance example :

Instance is used to select the backend with a "friendly" name. Example uses upstream but the same can be achieved with interface.

- upstream: 0.0.0.1:1080
  instance: us.01
- upstream: 0.0.0.2:1080
  instance: us.02
- upstream: 0.0.0.3:1080
  instance: us.03
- upstream: 0.0.0.4:1080
  instance: us.04

Service ran as [set any value as the username]:

moxxiproxy run --upstream=true --auth=testuser:

Consumed as [just make sure the user matches]:

curl -kxhttp://testuser_instance-us.04:@0.0.0.0:1989 http://page.com

session example :

Session is an arbitrary value sent that moxxi with use as a key for session stickyness. Example uses upstream but the same can be achieved with interface.

- upstream: 0.0.0.1:1080
- upstream: 0.0.0.2:1080
- upstream: 0.0.0.3:1080
- upstream: 0.0.0.4:1080

Service ran as [set any value as the username]:

moxxiproxy run --upstream=true --auth=testuser:

Consumed as:

curl -kxhttp://testuser_session-1234:@0.0.0.0:1989 http://page.com

This will create a session under ID: 1234 and any request with that ID will use the same exit node

Sample users file:

user1: password1
user2: password2

Service ran as [path can be anything]:

moxxiproxy run --usersfile=users.yml

Containers

The Dockerfile.example should serve as a guideline for those inclined to run moxxiproxy as a Docker container.

About

A REALLY fast proxy manager, battle tested with 200K concurrent connections on mid-sized (8 core + 16gb) hardware.

Resources

License

Stars

Watchers

Forks

Packages

No packages published