title: Python socket module: http proxy
body: <p>Hello I'm trying to use protected http socks server with socket module as in the code shown below</p>
  
  <p><code>
  &gt;&gt;&gt; import socket<br />
  &gt;&gt;&gt; s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br />
  &gt;&gt;&gt; host = '<a href="http://user:pass@server.com" rel="nofollow noreferrer">http://user:pass@server.com</a>'<br />
  &gt;&gt;&gt; port = 8888<br />
  &gt;&gt;&gt; s.bind((host, port))
  </code></p>
  
  <p>It gives me error: 
  <code>
  socket.gaierror: [Errno -2] Name or service not known
  </code></p>
  
  <p>Though if I setup proxy on a Firefox it works fine. What is in the code?</p>
  
  <p>Sultan</p>