mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 09:25:41 +08:00
doc: add info for forwarder option: priority
This commit is contained in:
parent
e82ea75cba
commit
4967f0bd36
14
README.md
14
README.md
@ -56,7 +56,7 @@ General:
|
||||
|
||||
- Http and socks5 on the same port
|
||||
- Forward chain
|
||||
- HA or RR strategy for multiple forwarders
|
||||
- RR/HA/LHA strategy for multiple forwarders
|
||||
- Periodical proxy checking
|
||||
- Rule proxy based on destinations: [Config Examples](config/examples)
|
||||
|
||||
@ -109,7 +109,7 @@ glider -config CONFIGPATH -listen :8080 -verbose
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
glider v0.6.6 usage:
|
||||
glider v0.6.7 usage:
|
||||
-checkduration int
|
||||
proxy check interval(seconds) (default 30)
|
||||
-checkwebsite string
|
||||
@ -134,6 +134,8 @@ glider v0.6.6 usage:
|
||||
ipset name
|
||||
-listen value
|
||||
listen url, format: SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS
|
||||
-maxfailures int
|
||||
max failures to change forwarder status to disabled (default 3)
|
||||
-rulefile value
|
||||
rule file path
|
||||
-rules-dir string
|
||||
@ -211,6 +213,14 @@ DNS forwarding server:
|
||||
Available forward strategies:
|
||||
rr: Round Robin mode
|
||||
ha: High Availability mode
|
||||
lha: Latency based High Availability mode
|
||||
|
||||
Forwarder option scheme: FORWARD_URL[#OPTIONS]
|
||||
Available options for forwarders:
|
||||
priority: set the priority of that forwarder, default:0
|
||||
Examples:
|
||||
socks5://1.1.1.1:1080#priority=100
|
||||
vmess://[security:]uuid@host:port?alterID=num#priority=200
|
||||
|
||||
Config file format(see `glider.conf.example` as an example):
|
||||
# COMMENT LINE
|
||||
|
9
conf.go
9
conf.go
@ -188,6 +188,15 @@ func usage() {
|
||||
fmt.Fprintf(os.Stderr, "Available forward strategies:\n")
|
||||
fmt.Fprintf(os.Stderr, " rr: Round Robin mode\n")
|
||||
fmt.Fprintf(os.Stderr, " ha: High Availability mode\n")
|
||||
fmt.Fprintf(os.Stderr, " lha: Latency based High Availability mode\n")
|
||||
fmt.Fprintf(os.Stderr, "\n")
|
||||
|
||||
fmt.Fprintf(os.Stderr, "Forwarder option scheme: FORWARD_URL[#OPTIONS]\n")
|
||||
fmt.Fprintf(os.Stderr, " Available options for forwarders:\n")
|
||||
fmt.Fprintf(os.Stderr, " priority: set the priority of that forwarder, default:0\n")
|
||||
fmt.Fprintf(os.Stderr, " Examples:\n")
|
||||
fmt.Fprintf(os.Stderr, " socks5://1.1.1.1:1080#priority=100\n")
|
||||
fmt.Fprintf(os.Stderr, " vmess://[security:]uuid@host:port?alterID=num#priority=200\n")
|
||||
fmt.Fprintf(os.Stderr, "\n")
|
||||
|
||||
fmt.Fprintf(os.Stderr, "Config file format(see `"+app+".conf.example` as an example):\n")
|
||||
|
@ -58,10 +58,14 @@ listen=socks5://:1080
|
||||
# FORWARDERS
|
||||
# ----------
|
||||
# Forwarders, we can setup multiple forwarders.
|
||||
# forward=SCHEME#OPTIONS
|
||||
|
||||
# Socks5 proxy as forwarder
|
||||
# forward=socks5://192.168.1.10:1080
|
||||
|
||||
# Socks5 proxy as forwarder with priority 100
|
||||
# forward=socks5://192.168.1.10:1080#priority=100
|
||||
|
||||
# SS proxy as forwarder
|
||||
# forward=ss://method:pass@1.1.1.1:8443
|
||||
|
||||
|
@ -235,9 +235,9 @@ func (ha *haDialer) DialUDP(network, addr string) (pc net.PacketConn, writeTo ne
|
||||
return d.DialUDP(network, addr)
|
||||
}
|
||||
|
||||
// high availability forwarder
|
||||
// latency based high availability forwarder
|
||||
// 1. choose dialer whose priority is the highest
|
||||
// 2. choose dialer whose letency it the lowest
|
||||
// 2. choose dialer with the lowest latency
|
||||
type lhaDialer struct {
|
||||
*rrDialer
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user