Skip to content

Commit fdf00f0

Browse files
committed
websocket timeout
1 parent 7df7904 commit fdf00f0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Client.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ class Client extends EventEmitter {
220220
return;
221221
}
222222

223+
// Clear the default socket timeout for WebSocket connections
224+
// WebSocket connections are long-lived and should not timeout
225+
if (conn.setTimeout) {
226+
conn.setTimeout(0);
227+
this.debug('cleared socket timeout for websocket connection');
228+
}
229+
223230
// websocket requests are special in that we simply re-create the header info
224231
// then directly pipe the socket data
225232
// avoids having to rebuild the request and handle upgrades via the http client

0 commit comments

Comments
 (0)