Skip to content

Commit

Permalink
sipexer: apply -timeout-connect to wss
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Feb 9, 2025
1 parent cee3bd8 commit 3827f9e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sipexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,10 @@ func SIPExerSendWSS(dstSockAddr sgsip.SGSIPSocketAddress, wsurlp *url.URL, tplst
tlc.InsecureSkipVerify = true
}

netDialer := net.Dialer{}
if cliops.timeoutconnect > 0 {
netDialer.Timeout = time.Millisecond * time.Duration(cliops.timeoutconnect)
}
// open ws connection
// ws, err := websocket.Dial(wsurl, "", wsorigin)
seDlg.ConnWSS.Conn, err = websocket.DialConfig(&websocket.Config{
Expand All @@ -2036,6 +2040,7 @@ func SIPExerSendWSS(dstSockAddr sgsip.SGSIPSocketAddress, wsurlp *url.URL, tplst
Protocol: []string{cliops.wsproto},
Version: 13,
TlsConfig: &tlc,
Dialer: &netDialer,
Header: http.Header{"User-Agent": {"sipexer v" + sipexerVersion}},
})
if err != nil {
Expand Down

0 comments on commit 3827f9e

Please sign in to comment.