Skip to content

Implement options passing to websocket constructor#157

Closed
jazarja wants to merge 2 commits intobinance:masterfrom
jazarja:master
Closed

Implement options passing to websocket constructor#157
jazarja wants to merge 2 commits intobinance:masterfrom
jazarja:master

Conversation

@jazarja
Copy link
Copy Markdown

@jazarja jazarja commented May 11, 2024

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
        });

Copy link
Copy Markdown

@AlphaOmega113 AlphaOmega113 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@dimitrisn442
Copy link
Copy Markdown
Contributor

Hey @jazarja , we published a new modularised version of the TS connector that has a proxy configuration websockets. You can find more details on the migration guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants