mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
dns: change cache to lrucache
This commit is contained in:
1 parent
8495f16a76
commit
6d64ee4c0e
11 files changed
+146
-90
No files matched your search
+4
-3
@@ -54,11 +54,12 @@ func NewTLS(s string, d proxy.Dialer, p proxy.Proxy) (*TLS, error) {
|
||||
}
|
||||
|
||||
if t.serverName == "" {
|
||||
host, port, _ := net.SplitHostPort(t.addr)
|
||||
if port == "" {
|
||||
idx := strings.LastIndex(t.addr, ":")
|
||||
if idx == -1 {
|
||||
idx = len(t.addr)
|
||||
t.addr = net.JoinHostPort(t.addr, "443")
|
||||
}
|
||||
t.serverName = host
|
||||
t.serverName = t.addr[:idx]
|
||||
}
|
||||
|
||||
return t, nil
|
||||
|
||||
Reference in new issue
Block a user