Improve: simple dns prefetch

This commit is contained in:
Dreamacro
2018-06-11 18:36:39 +08:00
parent 4f192ef575
commit 4f769debe7
8 changed files with 30 additions and 21 deletions

View File

@ -1,5 +1,9 @@
package constant
import (
"net"
)
// Socks addr type
const (
AtypIPv4 = 1
@ -11,5 +15,13 @@ const (
type Addr struct {
AddrType int
Host string
IP *net.IP
Port string
}
func (addr *Addr) String() string {
if addr.Host == "" {
return addr.IP.String()
}
return addr.Host
}