binance-connector-node icon indicating copy to clipboard operation
binance-connector-node copied to clipboard

Implement options passing to websocket constructor

Open jazarja opened this issue 1 year ago • 0 comments

Websocket currently does not have built-in support for proxy configurations. Consequently, it's necessary to provide necessary options directly to the WebSocket constructor when establishing a connection.

Example:

import { SocksProxyAgent } from 'socks-proxy-agent';

...

this.wsClient = new WebsocketStream({
            callbacks,
            combinedStreams: true,
            agent: process.env.BINANCE_PROXY ? new SocksProxyAgent(
                process.env.BINANCE_PROXY
            ) : undefined
        });

jazarja avatar May 11 '24 02:05 jazarja