title: websockets.exceptions.ConnectionClosedOK: code = 1000 (OK), no reason
body: <ul>
  <li>I am trying to receive data from a website which use websocket. This acts like this:
  <a href="https://i.stack.imgur.com/OW6uk.png" rel="nofollow noreferrer">websocket handshaking</a></li>
  </ul>
  <p>Here is the code to catch data:</p>
  <pre><code>async def hello(symb_id: int):
      async with websockets.connect(&quot;wss://ws.bitpin.ir/&quot;, extra_headers = request_header, timeout=15) as websocket:
          await websocket.send('{&quot;method&quot;:&quot;sub_to_price_info&quot;}')
          recv_msg = await websocket.recv()
          if recv_msg == '{&quot;message&quot;: &quot;sub to price info&quot;}':
              await websocket.send(json.dumps({&quot;method&quot;:&quot;sub_to_market&quot;,&quot;id&quot;:symb_id}))
              recv_msg = await websocket.recv()
              counter = 1 
  
              while(1):
                  msg = await websocket.recv()
                  print(counter, msg[:100], end='\n\n')
                  counter+=1
  
  asyncio.run(hello(1))
  </code></pre>
  <ul>
  <li>After receiving about 100 message, I am facing with this error:</li>
  </ul>
  <pre><code>websockets.exceptions.ConnectionClosedOK: code = 1000 (OK), no reason
  </code></pre>
  <ul>
  <li>I tried to set <code>timeout</code> and <code>request headers</code> but these were not helpful</li>
  </ul>