glider is a forward proxy with multiple protocols support, and also a dns/dhcp server with ipset management features(like dnsmasq).
Go to file
2017-07-21 18:58:51 +08:00
.gitignore add config file support. 2017-07-18 19:25:54 +08:00
conn.go first commit 2017-07-13 21:55:41 +08:00
direct.go first commit 2017-07-13 21:55:41 +08:00
dnstun.go fixed a bug in strategy.go which may leads to infinite recursion in the condition of all remote proxy disabled. 2017-07-16 12:16:50 +08:00
glider.conf.sample update readme file. 2017-07-18 19:45:35 +08:00
http.go fixed a bug in upstream http proxy. 2017-07-16 20:13:01 +08:00
LICENSE Initial commit 2017-07-13 21:53:15 +08:00
main.go add config file support. 2017-07-18 19:25:54 +08:00
mixed.go fixed a bug in ha mode 2017-07-15 10:41:52 +08:00
proxy.go add config file support. 2017-07-18 19:25:54 +08:00
README.md added install info for ArchLinux 2017-07-21 18:58:51 +08:00
redir_win.go first commit 2017-07-13 21:55:41 +08:00
redir.go fixed a bug in proxy check which may leads to socket error: too many open files. 2017-07-14 20:52:49 +08:00
socks5.go first commit 2017-07-13 21:55:41 +08:00
ss.go first commit 2017-07-13 21:55:41 +08:00
strategy.go add config file support. 2017-07-18 19:25:54 +08:00
tcptun.go first commit 2017-07-13 21:55:41 +08:00

glider

glider is a forward proxy with several protocols support.

Install

Binary:

Go Get :

go get -u github.com/nadoo/glider

ArchLinux:

sudo pacman -S glider

Run

glider -listen :8443 -verbose

with config file:

glider -config CONFIGPATH

Usage

glider v0.2 usage:
  -checkduration int
        proxy check duration(seconds) (default 30)
  -checkhost string
        proxy check address (default "www.apple.com:443")
  -config string
        config file path
  -forward value
        forward url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT[,SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT]
  -listen value
        listen url, format: SCHEMA://[USER|METHOD:PASSWORD@][HOST]:PORT
  -strategy string
        forward strategy, default: rr (default "rr")
  -verbose
        verbose mode

Available Schemas:
  mixed: serve as a http/socks5 proxy on the same port. (default)
  ss: ss proxy
  socks5: socks5 proxy
  http: http proxy
  redir: redirect proxy. (used on linux as a transparent proxy with iptables redirect rules)
  tcptun: a simple tcp tunnel
  dnstun: listen on udp port and forward all dns requests to remote dns server via forwarders(tcp)

Available schemas for different modes:
  listen: mixed ss socks5 http redir tcptun dnstun
  forward: ss socks5 http

Available methods for ss:
  AEAD_AES_128_GCM AEAD_AES_192_GCM AEAD_AES_256_GCM AEAD_CHACHA20_POLY1305 AES-128-CFB AES-128-CTR AES-192-CFB AES-192-CTR AES-256-CFB AES-256-CTR CHACHA20-IETF XCHACHA20

Available forward strategies:
  rr: Round Robin mode
  ha: High Availability mode

Examples:
  glider -config glider.conf
    -run glider with specified config file.

  glider -listen :8443
    -listen on :8443, serve as http/socks5 proxy on the same port.

  glider -listen ss://AEAD_CHACHA20_POLY1305:pass@:8443
    -listen on 0.0.0.0:8443 as a shadowsocks server.

  glider -listen socks5://:1080 -verbose
    -listen on :1080 as a socks5 proxy server, in verbose mode.

  glider -listen http://:8080 -forward socks5://127.0.0.1:1080
    -listen on :8080 as a http proxy server, forward all requests via socks5 server.

  glider -listen redir://:1081 -forward ss://method:pass@1.1.1.1:443
    -listen on :1081 as a transparent redirect server, forward all requests via remote ss server.

  glider -listen tcptun://:80=2.2.2.2:80 -forward ss://method:pass@1.1.1.1:443
    -listen on :80 and forward all requests to 2.2.2.2:80 via remote ss server.

  glider -listen socks5://:1080 -listen http://:8080 -forward ss://method:pass@1.1.1.1:443
    -listen on :1080 as socks5 server, :8080 as http proxy server, forward all requests via remote ss server.

  glider -listen redir://:1081 -listen dnstun://:53=8.8.8.8:53 -forward ss://method:pass@server1:port1,ss://method:pass@server2:port2
    -listen on :1081 as transparent redirect server, :53 as dns server, use forward chain: server1 -> server2.

  glider -listen socks5://:1080 -forward ss://method:pass@server1:port1 -forward ss://method:pass@server2:port2 -strategy rr
    -listen on :1080 as socks5 server, forward requests via server1 and server2 in roundrbin mode.

Config File

Command:

glider -config glider.conf

Config file, just use the command line flag name as the key name:

### glider config file

# verbose mode, print logs
verbose

# listen on 8443, serve as http/socks5 proxy on the same port.
listen=:8443

# listen on 8443 as a ss server.
# listen=ss://AEAD_CHACHA20_POLY1305:pass@:8443

# listen=http://:8080
# listen=socks5://:1080
# listen=redir://:1081
# listen=tcptun://:8080=1.1.1.1:80

# listen on udp port 53, forward dns requests via tcp protocol
listen=dnstun://:53=8.8.8.8:53

# upstream forward proxy
forward=socks5://192.168.1.10:1080

# upstream forward proxy
forward=ss://method:pass@1.1.1.1:443

# upstream forward proxy (forward chain)
forward=http://1.1.1.1:8080,socks5://2.2.2.2:1080

# multiple upstream proxies forwad strategy
strategy=rr

# check address (to check a whether a forward proxy)
checkhost=www.apple.com:443
# check duration
checkduration=30

Service

cd /etc/systemd/system/
vim glider.service
[Unit]
Description=glider
After=network.target

[Service]
Type=simple
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/glider
ExecStartPre=/bin/chown nobody:nobody /run/glider
# NOTE: change to your glider path
ExecStart=/opt/glider/glider -config /opt/glider/glider.conf
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -INT $MAINPID
Restart=always
User=nobody
Group=nobody
UMask=0027

[Install]
WantedBy=multi-user.target
systemctl enable glider.service
systemctl start glider.service