':param ip: IP address to bind
:param port: Port to bind
:param uri_opener: The uri_opener that will be used to open
the requests that arrive from the browser
:param handler_klass: A class that will know how to handle
requests from the browser'

def __init__(self, ip, port, uri_opener, handler_klass=ProxyHandler, ca_certs=CA_CERT_DIR, name='ProxyThread'):

    Process.__init__(self)
    self.daemon = True
    self.name = name
    self._server = None
    self._running = False
    self._uri_opener = uri_opener
    self._ca_certs = ca_certs
    self.total_handled_requests = 0
    try:
        self._config = ProxyConfig(cadir=self._ca_certs, ssl_version_client='SSLv23', ssl_version_server='SSLv23', host=ip, port=port)
    except AttributeError as ae:
        if (str(ae) == "'module'    object    has    no    attribute    '_lib'"):
            raise ProxyException((self.INCORRECT_SETUP % ae))
        else:
            raise
    self._config.openssl_options_client = None
    self._config.openssl_options_server = None
    try:
        self._server = ProxyServer(self._config)
    except socket.error as se:
        raise ProxyException(('Socket    error    while    starting    proxy:    "%s"' % se.strerror))
    except ProxyServerError as pse:
        raise ProxyException(('%s' % pse))
    else:
        self._config.port = self.get_port()
    self._master = handler_klass(self._server, self._uri_opener, self)
