def run(cmdargs): args = [ (cmdargs.localhost, cmdargs.localport), (cmdargs.remotehost, cmdargs.remoteport) ] kwargs = {} if cmdargs.sslboth: kwargs['ssl'] = True if not cmdargs.certfile or not cmdargs.keyfile: print ('You need to specify a valid certificate file and a key file!') sys.exit(1) kwargs['certfile'] = cmdargs.certfile kwargs['keyfile'] = cmdargs.keyfile elif cmdargs.sslout: kwargs['ssl_out_only'] = True kwargs['debug'] = False if cmdargs.username and cmdargs.password: credentials = store_credentials.StoreCredentials() credentials.username = cmdargs.username credentials.password = cmdargs.password credentials.stored = True else: credentials = credentials_emailing.StoreCredentials() #credentials.username = config.username #credentials.password = config.password credentials.stored = True kwargs['credential_validator'] = credentials server = ProxyServer(*args, **kwargs) server.run()
def main(): """Init and run HttpServer""" server = ProxyServer("config.json") server.run()
def main(): proxy = ProxyServer() proxy.run()
def main(): proxy_server = ProxyServer('localhost', 9001, 100, 4092) proxy_server.run()