fix transport error displaying

This commit is contained in:
Page Fault
2020-06-21 02:18:10 +00:00
parent 768bed337f
commit 3e196db29d
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -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 {
+1 -1
View File
@@ -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,