title: Connecting to socket with authentication in python
body: <p>I'm trying to connect to a mongodb instance through a python socket. The url looks like this</p>
  
  <p>username:password@host.com:port</p>
  
  <p>how can I connect to this with a python socket?</p>
  
  <p>The following code gives me this error: [Errno -5] No address associated with hostname</p>
  
  <pre><code>import socket
  import tornado
  
  full_url = '%s:%s@%s' % (username, password, host)
  s = socket.socket()
  s.connect((full_url, port))
  stream = iostream.IOStream(s)
  </code></pre>
  
  <p>EDIT - the reason I ask is because asyncmongo doesn't support this type of url right now. I'm trying to see if I can write a patch. The asyncmongo library connects using a socket like the one in the code above. </p>