title: How to get client IP from SimpleHTTPServer
body: <p>Building a simple file server using the <code>SimpleHTTPServer</code> module in Python, however I'm running into issues when trying to get the IP from a connecting client. Here is what I have..</p>
  
  <pre><code>import SimpleHTTPServer
  
  Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
  httpd = SocketServer.TCPServer(("", 8080), Handler)
  
  print "Serving local directory"
  
  while True:
      httpd.handle_request()
      print Handler.client_address[0]
  </code></pre>
  
  <p>When a client connects I get..</p>
  
  <blockquote>
    <p>AttributeError: class SimpleHTTPRequestHandler has no attribute 'client_address'</p>
  </blockquote>
  
  <p>I know this is because I haven't instantiated the class yet, but is there another way to get the IP from the client without having to create a handler instance? The client's IP is outputted to the console when a connection is made, I just need a way to grab that IP within my script.</p>
  
  <p>Thanks!</p>