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
|
||||
|
||||
```bash
|
||||
glider v0.6.5 usage:
|
||||
glider v0.6.6 usage:
|
||||
-checkduration int
|
||||
proxy check duration(seconds) (default 30)
|
||||
proxy check interval(seconds) (default 30)
|
||||
-checkwebsite string
|
||||
proxy check HTTP(NOT HTTPS) website address, format: HOST[:PORT], default port: 80 (default "www.apple.com")
|
||||
-config string
|
||||
config file path
|
||||
-dns string
|
||||
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
|
||||
custom dns record, format: domain/ip
|
||||
-dnsserver value
|
||||
remote dns server
|
||||
-dnstimeout int
|
||||
timeout value used in multiple dnsservers switch(seconds) (default 3)
|
||||
-forward value
|
||||
forward url, format: SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS]
|
||||
-ipset string
|
||||
|
@ -91,7 +91,9 @@ func (c *Client) Exchange(reqBytes []byte, clientAddr string, preferTCP bool) ([
|
||||
if answer.IP != "" {
|
||||
ips = append(ips, answer.IP)
|
||||
}
|
||||
ttl = int(answer.TTL)
|
||||
if answer.TTL != 0 {
|
||||
ttl = int(answer.TTL)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,11 @@ func NewWS(s string, dialer proxy.Dialer) (*WS, error) {
|
||||
|
||||
addr := u.Host
|
||||
|
||||
// TODO:
|
||||
if addr == "" {
|
||||
addr = dialer.Addr()
|
||||
}
|
||||
|
||||
colonPos := strings.LastIndex(addr, ":")
|
||||
if colonPos == -1 {
|
||||
colonPos = len(addr)
|
||||
|
Loading…
Reference in New Issue
Block a user