Skip to content

Commit

Permalink
fix transport error displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
p4gefau1t committed Jun 21, 2020
1 parent 768bed3 commit 3e196db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions redirector/redirector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tunnel/transport/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3e196db

Please sign in to comment.