MCPcopy Index your code
hub / github.com/cipheras/cipherginx / runServer

Function runServer

cipherginx.py:295–317  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293 """ Make our HTTP server multi-threaded """
294
295def runServer():
296 try:
297 logging.captureWarnings(True)
298 logging.info('HTTP server is starting on port ' + str(port))
299 server_address = (server, port)
300 # httpd = HTTPServer(server_address, ProxyHTTPRequestHandler)
301 httpd = ThreadedHTTPServer(server_address, ProxyHTTPRequestHandler)
302 if isSSL:
303 httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True, certfile='cert/server.pem')
304 if hostname=="accounts.google.com":
305 subprocess.Popen(['bin/generate.exe']) if platform=='win32' else subprocess.Popen(['bin/generate'])
306 logging.info('HTTP server is running as reverse proxy')
307 httpd.serve_forever()
308 except KeyboardInterrupt:
309 logging.info('\nExiting...')
310 logging.debug('ctrl + c pressed')
311 httpd.server_close()
312 time.sleep(1)
313 print(CLEAR)
314 exit(0)
315 except Exception as e:
316 logging.error(RED + str(e))
317 logging.debug('check domain name and ssl cert', exc_info=True)
318
319if __name__ == '__main__':
320 cwin()

Callers 1

cipherginx.pyFile · 0.85

Calls 1

ThreadedHTTPServerClass · 0.85

Tested by

no test coverage detected