aboutsummaryrefslogtreecommitdiff
path: root/cmd/dendrite-demo-pinecone/conn/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/dendrite-demo-pinecone/conn/client.go')
-rw-r--r--cmd/dendrite-demo-pinecone/conn/client.go14
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)
}