title: How do I switch this Proxy to use Proxy-Authentication?
body: <p>I'm trying to modify my simple Twisted web proxy to use "Proxy-Authentication" (username/password) instead of the current IP based authentication.  Problem is, I'm new to Twisted and don't even know where to start.  </p>
  
  <p>Here is my Factory Class.</p>
  
  <pre><code>class ProxyFactory(http.HTTPFactory):
      def __init__(self, ip, internal_ips):
          http.HTTPFactory.__init__(self)
          self.ip = ip
          self.protocol = proxy.Proxy
          self.INTERNAL_IPS = internal_ips
  
  
      def buildProtocol(self, addr):
          print addr
          # IP based authentication -- need to switch this to use standard Proxy password authentication
          if addr.host not in self.INTERNAL_IPS:
              return None
          #p = protocol.ServerFactory.buildProtocol(self, addr)
          p = self.protocol()
          p.factory = self
          # timeOut needs to be on the Protocol instance cause
          # TimeoutMixin expects it there
          p.timeOut = self.timeOut
          return p
  </code></pre>
  
  <p>Any idea what I need to do to make this work?  Thanks for your help!</p>