Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Fix connecting via Tor #2934

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/comms/wsconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (conn *wsConn) setConnectionStatus(status ConnectionStatus) {
// connect attempts to establish a websocket connection.
func (conn *wsConn) connect(ctx context.Context) error {
dialer := &websocket.Dialer{
HandshakeTimeout: 10 * time.Second,
HandshakeTimeout: DefaultResponseTimeout,
TLSClientConfig: conn.tlsCfg,
}
if conn.cfg.NetDialContext != nil {
Expand Down
5 changes: 3 additions & 2 deletions client/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -8111,14 +8111,15 @@ func (c *Core) newDEXConnection(acctInfo *db.AccountInfo, flag connectDEXFlag) (
return nil, errors.New("tor must be configured for .onion addresses")
}
proxyAddr = c.cfg.Onion

wsURL.Scheme = "ws"
wsCfg.URL = wsURL.String()
}
proxy := &socks.Proxy{
Addr: proxyAddr,
TorIsolation: c.cfg.TorIsolation, // need socks.NewPool with isolation???
}
wsCfg.NetDialContext = proxy.DialContext
wsURL.Scheme = "ws"
wsCfg.URL = wsURL.String()
}

wsCfg.ConnectEventFunc = func(status comms.ConnectionStatus) {
Expand Down
Loading