Documentation ¶
Index ¶
- Variables
- func DialTCP(address string, dnsserver string) (net.Conn, error)
- func DialTCPContext(ctx context.Context, address string, dnsserver string) (net.Conn, error)
- func HandleError()
- func Pip(from Connection, to Connection)
- func RandKey() string
- func ReadHeader(conn net.Conn) (string, error)
- type Connection
- type TlsCert
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DialTCP ¶ added in v0.0.4
通过指定的dnsserver查询dns, 返回和address的TCP连接 e.g. address www.baidu.com dnsserver 8.8.8.8:53
Windows下,会直接使用调用系统的dns查询,不会生效 其它系统,会从8.8.8.8:53查询到对应ip,并与之建立TCP连接
以下为解释: https://pkg.go.dev/net#hdr-Name_Resolution Windows下总是会调用C库,所以无法指定
https://github.com/golang/go/issues/22846 容器里需要注意新建 /etc/nsswitch.conf文件
echo "hosts: files dns" > /etc/nsswitch.conf Android Termux, 如果不指定dnsserver, 则默认会去读取/etc/resolv.conf 问题是该文件不存在, 或者是没有权限读取, 默认dns server [::1]:53, 那么肯定失败
echo "nameserver 114.114.114.114" > /etc/resolv.conf
func DialTCPContext ¶ added in v0.0.11
func HandleError ¶
func HandleError()
func Pip ¶
func Pip(from Connection, to Connection)
Types ¶
type Connection ¶ added in v0.0.6
type TlsCert ¶ added in v0.0.12
type TlsCert struct { CertPath string KeyPath string AttempDuration time.Duration // contains filtered or unexported fields }
func (*TlsCert) GetCertFunc ¶ added in v0.0.12
func (t *TlsCert) GetCertFunc() func(*tls.ClientHelloInfo) (*tls.Certificate, error)
Click to show internal directories.
Click to hide internal directories.