Пример #1
0
    def setUp(self):
        self.proxy = compat_http_server.HTTPServer(
            ('127.0.0.1', 0), _build_proxy_handler('normal'))
        self.port = http_server_port(self.proxy)
        self.proxy_thread = threading.Thread(target=self.proxy.serve_forever)
        self.proxy_thread.daemon = True
        self.proxy_thread.start()

        self.geo_proxy = compat_http_server.HTTPServer(
            ('127.0.0.1', 0), _build_proxy_handler('geo'))
        self.geo_port = http_server_port(self.geo_proxy)
        self.geo_proxy_thread = threading.Thread(
            target=self.geo_proxy.serve_forever)
        self.geo_proxy_thread.daemon = True
        self.geo_proxy_thread.start()
Пример #2
0
 def setUp(self):
     self.httpd = compat_http_server.HTTPServer(('127.0.0.1', 0),
                                                HTTPTestRequestHandler)
     self.port = http_server_port(self.httpd)
     self.server_thread = threading.Thread(target=self.httpd.serve_forever)
     self.server_thread.daemon = True
     self.server_thread.start()
Пример #3
0
 def setUp(self):
     certfn = os.path.join(TEST_DIR, 'testcert.pem')
     self.httpd = compat_http_server.HTTPServer(('127.0.0.1', 0),
                                                HTTPTestRequestHandler)
     self.httpd.socket = ssl.wrap_socket(self.httpd.socket,
                                         certfile=certfn,
                                         server_side=True)
     self.port = http_server_port(self.httpd)
     self.server_thread = threading.Thread(target=self.httpd.serve_forever)
     self.server_thread.daemon = True
     self.server_thread.start()
Пример #4
0
 def setUp(self):
     certfn = os.path.join(TEST_DIR, 'testcert.pem')
     self.httpd = compat_http_server.HTTPServer(('127.0.0.1', 0),
                                                HTTPTestRequestHandler)
     sslctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
     sslctx.load_cert_chain(certfn, None)
     self.httpd.socket = sslctx.wrap_socket(self.httpd.socket,
                                            server_side=True)
     self.port = http_server_port(self.httpd)
     self.server_thread = threading.Thread(target=self.httpd.serve_forever)
     self.server_thread.daemon = True
     self.server_thread.start()