mirror of
https://github.com/nadoo/glider.git
synced 2025-04-21 19:52:07 +08:00
add some example configs
This commit is contained in:
parent
f691306853
commit
c8ae638fcc
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
# custom
|
# custom
|
||||||
*.zip
|
*.zip
|
||||||
*.conf
|
/*.conf
|
||||||
*.rule
|
/*.rule
|
||||||
glider
|
glider
|
||||||
bak/
|
bak/
|
||||||
|
@ -36,6 +36,7 @@ TODO:
|
|||||||
- TUN/TAP device support
|
- TUN/TAP device support
|
||||||
- Code refactoring: support proxy registering so it can be pluggable
|
- Code refactoring: support proxy registering so it can be pluggable
|
||||||
- Conditional compilation so we can abandon needless proxy type and get a smaller binary size
|
- Conditional compilation so we can abandon needless proxy type and get a smaller binary size
|
||||||
|
- SSH tunnel support
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
Binary:
|
Binary:
|
||||||
|
92
examples/README.md
Normal file
92
examples/README.md
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
|
||||||
|
# Glider Configuration Examples
|
||||||
|
|
||||||
|
## Simple Proxy Service
|
||||||
|
Just listen on 8443 as HTTP/SOCKS5 proxy on the same port, forward all requests directly.
|
||||||
|
|
||||||
|
```
|
||||||
|
Clients --> Listener --> Internet
|
||||||
|
```
|
||||||
|
|
||||||
|
- [simple_proxy_service](simple_proxy_service)
|
||||||
|
|
||||||
|
## One remote upstream proxy
|
||||||
|
|
||||||
|
```
|
||||||
|
Clients --> Listener --> Forwarder --> Internet
|
||||||
|
```
|
||||||
|
|
||||||
|
- [one_forwarder](one_forwarder)
|
||||||
|
|
||||||
|
## One remote upstream PROXY CHAIN
|
||||||
|
|
||||||
|
```
|
||||||
|
Clients --> Listener --> Forwarder1 --> Forwarder2 --> Internet
|
||||||
|
```
|
||||||
|
|
||||||
|
- [forward_chain](forward_chain)
|
||||||
|
|
||||||
|
## Multiple upstream proxies
|
||||||
|
|
||||||
|
```
|
||||||
|
|Forwarder ----------------->|
|
||||||
|
Clients --> Listener --> | | Internet
|
||||||
|
|Forwarder --> Forwarder->...|
|
||||||
|
```
|
||||||
|
|
||||||
|
- [multiple_forwarders](multiple_forwarders)
|
||||||
|
|
||||||
|
|
||||||
|
## With Rule File: Default Direct, Rule file use forwarder
|
||||||
|
|
||||||
|
Default:
|
||||||
|
```
|
||||||
|
Clients --> Listener --> Internet
|
||||||
|
```
|
||||||
|
Destinations specified in rule file:
|
||||||
|
```
|
||||||
|
|Forwarder ----------------->|
|
||||||
|
Clients --> Listener --> | | Internet
|
||||||
|
|Forwarder --> Forwarder->...|
|
||||||
|
```
|
||||||
|
|
||||||
|
- [rule_default_direct](rule_default_direct)
|
||||||
|
|
||||||
|
|
||||||
|
## With Rule File: Default use forwarder, rule file use direct
|
||||||
|
|
||||||
|
Default:
|
||||||
|
```
|
||||||
|
|Forwarder ----------------->|
|
||||||
|
Clients --> Listener --> | | Internet
|
||||||
|
|Forwarder --> Forwarder->...|
|
||||||
|
```
|
||||||
|
|
||||||
|
Destinations specified in rule file:
|
||||||
|
```
|
||||||
|
Clients --> Listener --> Internet
|
||||||
|
```
|
||||||
|
|
||||||
|
- [rule_default_forwarder](rule_default_forwarder)
|
||||||
|
|
||||||
|
|
||||||
|
## With Rule File: multiple rule files
|
||||||
|
|
||||||
|
Default:
|
||||||
|
```
|
||||||
|
Clients --> Listener --> Internet
|
||||||
|
```
|
||||||
|
Destinations specified in rule file1:
|
||||||
|
```
|
||||||
|
|Forwarder1 ----------------->|
|
||||||
|
Clients --> Listener --> | | Internet
|
||||||
|
|Forwarder2 --> Forwarder3->...|
|
||||||
|
```
|
||||||
|
Destinations specified in rule file2:
|
||||||
|
```
|
||||||
|
|Forwarder4 ----------------->|
|
||||||
|
Clients --> Listener --> | | Internet
|
||||||
|
|Forwarder5 --> Forwarder6->...|
|
||||||
|
```
|
||||||
|
|
||||||
|
- [rule_multiple_rule_files](rule_multiple_rule_files)
|
8
examples/forward_chain/glider.conf
Normal file
8
examples/forward_chain/glider.conf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
# Verbose mode, print logs
|
||||||
|
verbose=True
|
||||||
|
|
||||||
|
listen=:8443
|
||||||
|
|
||||||
|
# first connect forwarder1 then forwarder2 then internet
|
||||||
|
forward=http://forwarder1:8080,socks5://forwarder2:1080,
|
21
examples/multiple_forwarders/glider.conf
Normal file
21
examples/multiple_forwarders/glider.conf
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
# Verbose mode, print logs
|
||||||
|
verbose=True
|
||||||
|
|
||||||
|
listen=:8443
|
||||||
|
|
||||||
|
# first connect forwarder1 then forwarder2 then internet
|
||||||
|
forward=http://forwarder1:8080,socks5://forwarder2:1080,
|
||||||
|
forward=http://1.1.1.1:8080
|
||||||
|
|
||||||
|
# Round Robin mode: rr
|
||||||
|
# High Availability mode: ha
|
||||||
|
strategy=rr
|
||||||
|
|
||||||
|
# Used to connect via forwarders, if the host is unreachable, the forwarder
|
||||||
|
# will be set to disabled.
|
||||||
|
# MUST BE A HTTP or HTTPS WEBSITE HOST ADDRESS
|
||||||
|
checkwebsite=www.apple.com:443
|
||||||
|
|
||||||
|
# check duration(seconds)
|
||||||
|
checkduration=30
|
7
examples/one_forwarder/glider.conf
Normal file
7
examples/one_forwarder/glider.conf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
# Verbose mode, print logs
|
||||||
|
verbose=True
|
||||||
|
|
||||||
|
listen=:8443
|
||||||
|
|
||||||
|
forward=socks5://192.168.1.10:1080
|
9
examples/rule_default_direct/glider.conf
Normal file
9
examples/rule_default_direct/glider.conf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
# Verbose mode, print logs
|
||||||
|
verbose=True
|
||||||
|
|
||||||
|
listen=:8443
|
||||||
|
|
||||||
|
# NOTE HERE:
|
||||||
|
# Specify a rule file
|
||||||
|
rulefile=office.rule
|
29
examples/rule_default_direct/office.rule
Normal file
29
examples/rule_default_direct/office.rule
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# first connect forwarder1 then forwarder2 then internet
|
||||||
|
forward=http://forwarder1:8080,socks5://forwarder2:1080,
|
||||||
|
forward=http://1.1.1.1:8080
|
||||||
|
|
||||||
|
# Round Robin mode: rr
|
||||||
|
# High Availability mode: ha
|
||||||
|
strategy=rr
|
||||||
|
|
||||||
|
checkwebsite=www.apple.com:443
|
||||||
|
checkduration=30
|
||||||
|
|
||||||
|
|
||||||
|
# matches abc.com and *.abc.com
|
||||||
|
domain=abc.com
|
||||||
|
|
||||||
|
# matches 1.1.1.1
|
||||||
|
ip=1.1.1.1
|
||||||
|
|
||||||
|
# matches 192.168.100.0/24
|
||||||
|
cidr=192.168.100.0/24
|
||||||
|
|
||||||
|
domain=example1.com
|
||||||
|
domain=example2.com
|
||||||
|
domain=example3.com
|
||||||
|
ip=2.2.2.2
|
||||||
|
ip=3.3.3.3
|
||||||
|
cidr=172.16.0.0/24
|
8
examples/rule_default_forwarder/bypass.rule
Normal file
8
examples/rule_default_forwarder/bypass.rule
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
# matches abc.com and *.abc.com
|
||||||
|
domain=abc.com
|
||||||
|
|
||||||
|
ip=127.0.0.1
|
||||||
|
cidr=192.168.0.0/24
|
||||||
|
cidr=192.168.1.0/24
|
||||||
|
cidr=172.16.0.0/24
|
22
examples/rule_default_forwarder/glider.conf
Normal file
22
examples/rule_default_forwarder/glider.conf
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Verbose mode, print logs
|
||||||
|
verbose=True
|
||||||
|
|
||||||
|
listen=:8443
|
||||||
|
|
||||||
|
# first connect forwarder1 then forwarder2 then internet
|
||||||
|
forward=http://forwarder1:8080,socks5://forwarder2:1080,
|
||||||
|
forward=http://1.1.1.1:8080
|
||||||
|
|
||||||
|
# Round Robin mode: rr
|
||||||
|
# High Availability mode: ha
|
||||||
|
strategy=rr
|
||||||
|
|
||||||
|
checkwebsite=www.apple.com:443
|
||||||
|
checkduration=30
|
||||||
|
|
||||||
|
|
||||||
|
# NOTE HERE:
|
||||||
|
# Specify a rule file
|
||||||
|
rulefile=bypass.rule
|
12
examples/rule_multiple_rule_files/glider.conf
Normal file
12
examples/rule_multiple_rule_files/glider.conf
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# Verbose mode, print logs
|
||||||
|
verbose=True
|
||||||
|
|
||||||
|
listen=:8443
|
||||||
|
|
||||||
|
# NOTE HERE:
|
||||||
|
# specify a rule file
|
||||||
|
rulefile=office.rule
|
||||||
|
|
||||||
|
# specify another rule file
|
||||||
|
rulefile=home.rule
|
18
examples/rule_multiple_rule_files/home.rule
Normal file
18
examples/rule_multiple_rule_files/home.rule
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
forward=http://forwarder4:8080
|
||||||
|
|
||||||
|
# first connect forwarder1 then forwarder2 then internet
|
||||||
|
forward=http://forwarder5:8080,socks6://forwarder3:1080,
|
||||||
|
|
||||||
|
|
||||||
|
# Round Robin mode: rr
|
||||||
|
# High Availability mode: ha
|
||||||
|
strategy=rr
|
||||||
|
|
||||||
|
checkwebsite=www.apple.com:443
|
||||||
|
checkduration=30
|
||||||
|
|
||||||
|
|
||||||
|
# matches 192.168.0.0/16
|
||||||
|
cidr=192.168.0.0/16
|
18
examples/rule_multiple_rule_files/office.rule
Normal file
18
examples/rule_multiple_rule_files/office.rule
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
forward=http://forwarder1:8080
|
||||||
|
|
||||||
|
# first connect forwarder1 then forwarder2 then internet
|
||||||
|
forward=http://forwarder2:8080,socks5://forwarder3:1080,
|
||||||
|
|
||||||
|
|
||||||
|
# Round Robin mode: rr
|
||||||
|
# High Availability mode: ha
|
||||||
|
strategy=rr
|
||||||
|
|
||||||
|
checkwebsite=www.apple.com:443
|
||||||
|
checkduration=30
|
||||||
|
|
||||||
|
|
||||||
|
# matches 172.16.0.0/24
|
||||||
|
cidr=172.16.0.0/24
|
5
examples/simple_proxy_service/glider.conf
Normal file
5
examples/simple_proxy_service/glider.conf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
# Verbose mode, print logs
|
||||||
|
verbose=True
|
||||||
|
|
||||||
|
listen=:8443
|
@ -27,3 +27,10 @@ ip=1.1.1.1
|
|||||||
|
|
||||||
# matches 192.168.100.0/24
|
# matches 192.168.100.0/24
|
||||||
cidr=192.168.100.0/24
|
cidr=192.168.100.0/24
|
||||||
|
|
||||||
|
domain=example1.com
|
||||||
|
domain=example2.com
|
||||||
|
domain=example3.com
|
||||||
|
ip=2.2.2.2
|
||||||
|
ip=3.3.3.3
|
||||||
|
cidr=172.16.0.0/24
|
||||||
|
Loading…
Reference in New Issue
Block a user