Skip to content

Commit

Permalink
Add example configs
Browse files Browse the repository at this point in the history
sorz committed Dec 20, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 51bb34c commit a8e669c
Showing 3 changed files with 68 additions and 0 deletions.
17 changes: 17 additions & 0 deletions conf/config.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Configuraion file loaded by moproxy.service

## TCP listen address
HOST="0.0.0.0"
PORT="2080"

## Web status page listen on
WEB_BIND="127.0.0.1:8080"

## List of backend proxy servers
PROXY_LIST="/etc/moproxy/proxy.ini"

## Other arguments passed to moproxy daemon
DAEMON_ARGS="--stats-bind ${WEB_BIND}"

## Enable remote DNS
# DAEMON_ARGS="${DAEMON_ARGS} --remote-dns"
27 changes: 27 additions & 0 deletions conf/moproxy.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[Unit]
Description=MoProxy transparent TCP proxy daemon.
After=network.target

[Service]
Type=notify
User=nobody
Group=nobody

Restart=on-failure
EnvironmentFile=/etc/moproxy/config.env
ExecStart=/usr/bin/moproxy -h $HOST -p $PORT --list $PROXY_LIST $DAEMON_ARGS --systemd

LimitNOFILE=32768
PrivateTmp=true
PrivateDevices=true
ProtectSystem=strict
ProtectHome=true
ProtectKernelModules=true
ProtectControlGroups=true

## Wait for WAN interface up
# ExecStartPre=/usr/lib/systemd/systemd-networkd-wait-online --interface=ppp0

[Install]
WantedBy=multi-user.target

24 changes: 24 additions & 0 deletions conf/proxy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Example of moproxy server list file.

# Each server starts with a unique `[SERVER-TAG]`,
# followed by a list of attributes.
#
# Attributes
# - address: IP-addr:port of the server.
# - protocol: HTTP or SOCKSv5.
# - test dns: IP-addr:port of a DNS server with TCP support.
# - score base: A fixed +/- integer added into server's score.
#
# `address` and `protocol` are mandatory, others are optional.

[server-1]
address=127.0.0.1:2001
protocol=socks5
[server-2]
address=127.0.0.1:2002
protocol=http
test dns=127.0.0.53:53 ;use remote's local dns server to caculate delay
[backup]
address=127.0.0.1:2002
protocol=socks5
score base=5000 ;add 5k to pull away from preferred server.

0 comments on commit a8e669c

Please sign in to comment.