Skip to content

Commit cde02b2

Browse files
committed
[feature] Add option to support late addition of headers
This supports the use-case where headers need to be added that depend on the socket connection (e.g. for TLS channel binding).
1 parent 41dc56a commit cde02b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/websocket.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,11 @@ function initAsClient(websocket, address, protocols, options) {
989989
});
990990
});
991991

992-
req.end();
992+
if (typeof opts.finishRequest === 'function') {
993+
opts.finishRequest(req, websocket);
994+
} else {
995+
req.end();
996+
}
993997
}
994998

995999
/**

0 commit comments

Comments
 (0)