0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

debugging

This commit is contained in:
Zack Scholl 2021-10-02 12:20:18 -07:00
parent ff4307c3c6
commit ce628ea604

View file

@ -40,11 +40,13 @@ func NewConnection(address string, timelimit ...time.Duration) (c *Comm, err err
socks5ProxyURL, urlParseError := url.Parse(Socks5Proxy) socks5ProxyURL, urlParseError := url.Parse(Socks5Proxy)
if urlParseError != nil { if urlParseError != nil {
err = fmt.Errorf("Unable to parse socks proxy url: %s", urlParseError) err = fmt.Errorf("Unable to parse socks proxy url: %s", urlParseError)
log.Debug(err)
return return
} }
dialer, err = proxy.FromURL(socks5ProxyURL, proxy.Direct) dialer, err = proxy.FromURL(socks5ProxyURL, proxy.Direct)
if err != nil { if err != nil {
err = fmt.Errorf("proxy failed: %w", err) err = fmt.Errorf("proxy failed: %w", err)
log.Debug(err)
return return
} }
connection, err = dialer.Dial("tcp", address) connection, err = dialer.Dial("tcp", address)
@ -53,6 +55,7 @@ func NewConnection(address string, timelimit ...time.Duration) (c *Comm, err err
} }
if err != nil { if err != nil {
err = fmt.Errorf("comm.NewConnection failed: %w", err) err = fmt.Errorf("comm.NewConnection failed: %w", err)
log.Debug(err)
return return
} }
c = New(connection) c = New(connection)