mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 17:35:40 +08:00
ws: fixed a bug when ws used as a middle layer protocol(tls,ws,vmess)
This commit is contained in:
parent
a26e437b5d
commit
2fcef7b00c
10
README.md
10
README.md
@ -109,19 +109,25 @@ glider -config CONFIGPATH -listen :8080 -verbose
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
glider v0.6.5 usage:
|
glider v0.6.6 usage:
|
||||||
-checkduration int
|
-checkduration int
|
||||||
proxy check duration(seconds) (default 30)
|
proxy check interval(seconds) (default 30)
|
||||||
-checkwebsite string
|
-checkwebsite string
|
||||||
proxy check HTTP(NOT HTTPS) website address, format: HOST[:PORT], default port: 80 (default "www.apple.com")
|
proxy check HTTP(NOT HTTPS) website address, format: HOST[:PORT], default port: 80 (default "www.apple.com")
|
||||||
-config string
|
-config string
|
||||||
config file path
|
config file path
|
||||||
-dns string
|
-dns string
|
||||||
dns forwarder server listen address
|
dns forwarder server listen address
|
||||||
|
-dnsmaxttl int
|
||||||
|
maximum TTL value for entries in the CACHE(seconds) (default 1800)
|
||||||
|
-dnsminttl int
|
||||||
|
minimum TTL value for entries in the CACHE(seconds)
|
||||||
-dnsrecord value
|
-dnsrecord value
|
||||||
custom dns record, format: domain/ip
|
custom dns record, format: domain/ip
|
||||||
-dnsserver value
|
-dnsserver value
|
||||||
remote dns server
|
remote dns server
|
||||||
|
-dnstimeout int
|
||||||
|
timeout value used in multiple dnsservers switch(seconds) (default 3)
|
||||||
-forward value
|
-forward value
|
||||||
forward url, format: SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS]
|
forward url, format: SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS]
|
||||||
-ipset string
|
-ipset string
|
||||||
|
@ -91,9 +91,11 @@ func (c *Client) Exchange(reqBytes []byte, clientAddr string, preferTCP bool) ([
|
|||||||
if answer.IP != "" {
|
if answer.IP != "" {
|
||||||
ips = append(ips, answer.IP)
|
ips = append(ips, answer.IP)
|
||||||
}
|
}
|
||||||
|
if answer.TTL != 0 {
|
||||||
ttl = int(answer.TTL)
|
ttl = int(answer.TTL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ttl > c.config.MaxTTL {
|
if ttl > c.config.MaxTTL {
|
||||||
ttl = c.config.MaxTTL
|
ttl = c.config.MaxTTL
|
||||||
|
@ -32,6 +32,11 @@ func NewWS(s string, dialer proxy.Dialer) (*WS, error) {
|
|||||||
|
|
||||||
addr := u.Host
|
addr := u.Host
|
||||||
|
|
||||||
|
// TODO:
|
||||||
|
if addr == "" {
|
||||||
|
addr = dialer.Addr()
|
||||||
|
}
|
||||||
|
|
||||||
colonPos := strings.LastIndex(addr, ":")
|
colonPos := strings.LastIndex(addr, ":")
|
||||||
if colonPos == -1 {
|
if colonPos == -1 {
|
||||||
colonPos = len(addr)
|
colonPos = len(addr)
|
||||||
|
Loading…
Reference in New Issue
Block a user