def proxy(args):
'''
Run a non-encyprted non-authorized API proxy server.
Use this only for development and testing!
'''
print_info('Starting an insecure API proxy at http://{0}:{1}'
.format(args.bind, args.port))
try:
addr = (args.bind, args.port)
httpd = http.server.HTTPServer(addr, APIProxyHandler)
httpd.serve_forever()
except (KeyboardInterrupt, SystemExit):
print()
print_info('Terminated.')
except:
print_fail('Unexpected error!')
traceback.print_exc()
评论列表
文章目录