Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit a78399a

Browse files
authored
Merge branch '1.x' into fix/websocket
2 parents 652d913 + fe269fb commit a78399a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/web3-providers-ws/src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,17 @@ var WebsocketProvider = function WebsocketProvider(url, options) {
8181

8282
// Allow a custom client configuration
8383
var clientConfig = options.clientConfig || undefined;
84+
85+
// Allow a custom request options
86+
// https://github.com/theturtle32/WebSocket-Node/blob/master/docs/WebSocketClient.md#connectrequesturl-requestedprotocols-origin-headers-requestoptions
87+
var requestOptions = options.requestOptions || undefined;
8488

8589
// When all node core implementations that do not have the
8690
// WHATWG compatible URL parser go out of service this line can be removed.
8791
if (parsedURL.auth) {
8892
headers.authorization = 'Basic ' + _btoa(parsedURL.auth);
8993
}
90-
this.connection = new Ws(url, protocol, undefined, headers, undefined, clientConfig);
94+
this.connection = new Ws(url, protocol, undefined, headers, requestOptions, clientConfig);
9195

9296
this.addDefaultEvents();
9397

0 commit comments

Comments
 (0)