用nodejs 链接 wss://stream.binance.com:9443/ws/ethusdt@depth@100ms 报错1006

我用以下代码链接websockStream
const callbacks = {
open: () => logger.debug(‘Connected with WebSocket server’),
close: () => logger.debug(‘Disconnected with WebSocket server’),
message: data => logger.info(‘Received data:’, data),
error: error => logger.error(‘WebSocket error:’, error)
};

this.spotStreamClient = new WebsocketStream({ logger, callbacks });

报错
Sending Websocket connection to: wss://stream.binance.com:9443/ws/ethusdt@depth@100ms
Received error from server
WebSocket error: undefined
Error: Client network socket disconnected before secure TLS connection was established
at TLSSocket.onConnectEnd (node:_tls_wrap:1732:19)
at TLSSocket.emit (node:events:530:35)
at endReadableNT (node:internal/streams/readable:1698:12)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
code: ‘ECONNRESET’,
path: undefined,
host: ‘stream.binance.com’,
port: ‘9443’,
localAddress: undefined
}
Disconnected with WebSocket server
Connection close due to 1006: .

this.futuresStreamClient = new UMStream({ logger, callbacks,httpsAgent: agent, });

UMStream 是可以链接的

我在控制台 用 websocat wss://stream.binance.com:9443/ws/ethusdt@depth@100ms 也链接不了
但 websocat wss://fstream.binancefuture.com/ws/ethusdt@depth@100ms 这个是可以的,请求帮助

Hi @haidong_li, can you provide more information on the version of the NodeJS connector that you’re using and the exact steps that you follow? Thanks!