Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGELOG
### NEXT RELEASE

* TS: fix socket/transport types (#790).
* Transport: Handle keep alive request from server (#791).


### 3.10.0
Expand Down
20 changes: 19 additions & 1 deletion lib/Transport.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,25 @@ module.exports = class Transport

_onData(data)
{
// CRLF Keep Alive response from server. Ignore it.
// CRLF Keep Alive request from server, reply.
if (data === '\r\n\r\n')
{
logger.debug('received message with double-CRLF Keep Alive request');

try
{
// Reply with single CRLF.
this.socket.send('\r\n');
}
catch (error)
{
logger.warn(`error sending Keep Alive response: ${error}`);
}

return;
}

// CRLF Keep Alive response from server, ignore it.
if (data === '\r\n')
{
logger.debug('received message with CRLF Keep Alive response');
Expand Down