Skip to content

Commit

Permalink
Merge branch '1.x' into fix/websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
nivida authored Jul 31, 2019
2 parents 652d913 + fe269fb commit a78399a
Showing 1 changed file with 5 additions and 1 deletion.
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 @@ -81,13 +81,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

0 comments on commit a78399a

Please sign in to comment.