mirror of
https://github.com/p4gefau1t/trojan-go.git
synced 2024-04-21 12:21:34 +00:00
fix transport error displaying
This commit is contained in:
@@ -42,6 +42,10 @@ func (r *Redirector) worker() {
|
||||
if redirection.Dial == nil {
|
||||
redirection.Dial = defaultDial
|
||||
}
|
||||
if redirection.RedirectTo == nil {
|
||||
log.Error("nil redirection addr")
|
||||
return
|
||||
}
|
||||
log.Warn("redirecting connection from", redirection.InboundConn.RemoteAddr(), "to", redirection.RedirectTo.String())
|
||||
outboundConn, err := redirection.Dial(redirection.RedirectTo)
|
||||
if err != nil {
|
||||
|
||||
@@ -37,7 +37,7 @@ func (c *Client) DialConn(*tunnel.Address, tunnel.Tunnel) (tunnel.Conn, error) {
|
||||
dialer := new(net.Dialer)
|
||||
conn, err := dialer.DialContext(c.ctx, "tcp", c.serverAddress.String())
|
||||
if err != nil {
|
||||
return nil, common.NewError("transport failed to connect to remote server")
|
||||
return nil, common.NewError("transport failed to connect to remote server").Base(err)
|
||||
}
|
||||
return &Conn{
|
||||
Conn: conn,
|
||||
|
||||
Reference in New Issue
Block a user