Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Merged
Changes from 2 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
6 changes: 5 additions & 1 deletion packages/web3-providers-ws/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,17 @@ var WebsocketProvider = function WebsocketProvider(url, options) {

// Allow a custom client configuration
var clientConfig = options.clientConfig || undefined;

// Allow a custom request options
// https://github.com/theturtle32/WebSocket-Node/blob/master/docs/WebSocketClient.md#connectrequesturl-requestedprotocols-origin-headers-requestoptions
var requestOptions = options.requestOptions || undefined;

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

this.addDefaultEvents();

Expand Down