title: How to send 'Headers' in websocket python
body: <p>how can i make this</p>
  
  <p>This is my code</p>
  
  <pre><code>
  import  websockets
  
  
  async def test():
      async with websockets.connect('ws://iqoption.com') as websocket:
          response = await websocket.recv()
          print(response)
  # Client async code
  </code></pre>
  
  <p>The cuestion is , can i send this headers to get Authenticated in the server</p>
  
  <p>Headers</p>
  
  <pre><code>    'Host':'iqoption.com',
      'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0',
      'Accept' : '*/*',
  'Accept-Encoding': 'gzip, deflate',
  'Sec-WebSocket-Version' : '13',
  'Origin' : 'https://iqoption.com',
      'Sec-WebSocket-Key': 'iExBWv1j6sC1uee2qD+QPQ==',
  'Connection' : 'keep-alive, Upgrade',
  'Upgrade': 'websocket'}
  </code></pre>
  
  <p>I could do it with this other code but the messages were still encrypted with tls</p>
  
  <pre><code>proxies = {"http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"}
  urllib3.disable_warnings()
  
  r = requests.get('https://iqoption.com/echo/websocket', stream=True,headers = Headers, proxies=proxies, verify=False)
  #r = requests.get('https://iqoption.com/echo/websocket', stream=True,headers = Headers)
  s = socket.fromfd(r.raw.fileno(), socket.AF_INET, socket.SOCK_STREAM)
  
  
  def receive_and_print():
      #for message in iter(lambda: s.recv(1024).decode("utf-8", errors="replace"), ''):
      for message in iter(lambda: s.recv(1024).decode( errors="replace"), ''):
          print(":", message)
          print("")
  import threading
  background_thread = threading.Thread(target=receive_and_print)
  background_thread.daemon = True
  background_thread.start()
  
  while 1:
      s.send(input("Please enter your message: ").encode())
      print("Sent")
      print("")
  </code></pre>
  
  <p>Any advice??</p>