Skip to content

Commit f5c2312

Browse files
committed
chore: send error code,msg on incoming close
1 parent ed04884 commit f5c2312

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/core/Context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class Context extends EventEmitter {
207207
});
208208

209209
this.outgoingSocket.on(kUpstreamClosed, (code, msg) => {
210-
this.incomingSocket.close();
210+
this.incomingSocket.close(code, msg);
211211
this.emit(kCleanup, this.connectionId);
212212
logger.info(
213213
`${OUTGOING} [${this.connectionId}] [CLOSE] - Socket closed with ${code} and ${msg}`

lib/core/IncomingWebSocket.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ class IncomingWebSocket extends EventEmitter {
115115
/**
116116
* Closes the socket connection.
117117
*/
118-
close() {
118+
close(code, msg) {
119119
this.teardown = true;
120+
this.socket.close(code, msg);
120121
this.socket.terminate();
121122
}
122123

0 commit comments

Comments
 (0)