add bind for relay
This commit is contained in:
@ -47,7 +47,7 @@ func (c *socks4Connector) Connect(ctx context.Context, conn net.Conn, network, a
|
||||
"network": network,
|
||||
"address": address,
|
||||
})
|
||||
c.logger.Infof("connect: %s/%s", address, network)
|
||||
c.logger.Infof("connect %s/%s", address, network)
|
||||
|
||||
switch network {
|
||||
case "tcp", "tcp4", "tcp6":
|
||||
|
@ -91,7 +91,12 @@ func (c *socks5Connector) Connect(ctx context.Context, conn net.Conn, network, a
|
||||
"network": network,
|
||||
"address": address,
|
||||
})
|
||||
c.logger.Infof("connect: %s/%s", address, network)
|
||||
c.logger.Infof("connect %s/%s", address, network)
|
||||
|
||||
if c.md.connectTimeout > 0 {
|
||||
conn.SetDeadline(time.Now().Add(c.md.connectTimeout))
|
||||
defer conn.SetDeadline(time.Time{})
|
||||
}
|
||||
|
||||
switch network {
|
||||
case "udp", "udp4", "udp6":
|
||||
@ -114,11 +119,6 @@ func (c *socks5Connector) Connect(ctx context.Context, conn net.Conn, network, a
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if c.md.connectTimeout > 0 {
|
||||
conn.SetDeadline(time.Now().Add(c.md.connectTimeout))
|
||||
defer conn.SetDeadline(time.Time{})
|
||||
}
|
||||
|
||||
req := gosocks5.NewRequest(gosocks5.CmdConnect, &addr)
|
||||
if err := req.Write(conn); err != nil {
|
||||
c.logger.Error(err)
|
||||
|
Reference in New Issue
Block a user