title: How to subscribe to the Binance market stream using Julia and WebSockets.jl
body: <p>I'm trying for a while now to connect to the <a href="https://binance-docs.github.io/apidocs/spot/en/#websocket-market-streams" rel="noreferrer">Binance market stream</a> using the <a href="https://github.com/JuliaWeb/WebSockets.jl" rel="noreferrer">WebSockets.jl</a> package but I do not get any response.
  I've already had a look here and found <a href="https://stackoverflow.com/questions/64540833/julia-how-to-subscribe-via-websockets">this question</a>, but this results in the same problem as described: the inbox channel is just waiting but gets no response.</p>
  <p>The code I've tried is as follows:</p>
  <pre><code>    using WebSockets, JSON
      
      uri = &quot;wss://stream.binance.com:9443&quot;
      json_part = &quot;{'method': 'SUBSCRIBE', 'params': ['btcusdt@depth'], 'id': 1}&quot;
      inbox = Channel{String}(10)
      outbox = Channel{String}(10)
  
      ws_task = @async WebSockets.open(uri) do ws
             inbox_task = @async while !eof(ws)
                 put!(inbox, String(read(ws)))
             end
             outbox_task = @async while isopen(ws)
                 write(ws, take!(outbox))
             end
         end
  
      put!(outbox, json_part)
      take!(inbox)
  </code></pre>
  <p>I've never used WebSockets before, so probably I'm just using the wrong endpoint or request formatting. But I can't find a better documentation or useful example.</p>
  <p>Can someone please help me get this to work?</p>