how to dynamic subscribe to a stream?

i try to connect to binance and then subscribe to a stream
such as:
Subscribe to a stream

Response

{
“result”: null,
“id”: 1
}

Request

{
"method": "SUBSCRIBE",
"params":
[
"btcusdt@aggTrade",
"btcusdt@depth"
],
"id": 1

but when i connect to binance,binance kick me off,i wonder why


can somebody please help thanks

missing ws in the end of the url.

wss://fstream.binance.com/ws

thank you .i found the answer.

Thanks dino! This solves the issue of " websocket ERROR :: Connection to remote host was lost. - goodbye" .