diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2021-05-24 13:12:05 +0100 |
---|---|---|
committer | Neil Alexander <neilalexander@users.noreply.github.com> | 2021-05-24 13:12:05 +0100 |
commit | a7f2845a6a97af0c1855eb3c8d81cb4ca348d176 (patch) | |
tree | 42b4cd2238b9d01223738e14fa3a22977efa756c /cmd/dendrite-demo-pinecone/conn/client.go | |
parent | 79c5485c8d29b103f2e4bc7f55d8d902bccc3d3a (diff) |
Demo tweaks
Diffstat (limited to 'cmd/dendrite-demo-pinecone/conn/client.go')
-rw-r--r-- | cmd/dendrite-demo-pinecone/conn/client.go | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/cmd/dendrite-demo-pinecone/conn/client.go b/cmd/dendrite-demo-pinecone/conn/client.go index 954564d4..66f9ebfa 100644 --- a/cmd/dendrite-demo-pinecone/conn/client.go +++ b/cmd/dendrite-demo-pinecone/conn/client.go @@ -5,7 +5,6 @@ import ( "net" "net/http" "strings" - "time" "github.com/gorilla/websocket" "github.com/matrix-org/dendrite/setup" @@ -17,24 +16,15 @@ import ( func ConnectToPeer(pRouter *pineconeRouter.Router, peer string) error { var parent net.Conn - dialer := net.Dialer{ - Timeout: time.Second * 5, - KeepAlive: time.Second * 5, - } if strings.HasPrefix(peer, "ws://") || strings.HasPrefix(peer, "wss://") { - wsdialer := websocket.Dialer{ - NetDial: dialer.Dial, - NetDialContext: dialer.DialContext, - HandshakeTimeout: time.Second * 5, - } - c, _, err := wsdialer.Dial(peer, nil) + c, _, err := websocket.DefaultDialer.Dial(peer, nil) if err != nil { return fmt.Errorf("websocket.DefaultDialer.Dial: %w", err) } parent = WrapWebSocketConn(c) } else { var err error - parent, err = dialer.Dial("tcp", peer) + parent, err = net.Dial("tcp", peer) if err != nil { return fmt.Errorf("net.Dial: %w", err) } |