|
@ -456,13 +456,15 @@ def main(): |
|
|
snrpc.debug = args.debug |
|
|
snrpc.debug = args.debug |
|
|
snrpc.defaultkey = args.key |
|
|
snrpc.defaultkey = args.key |
|
|
|
|
|
|
|
|
signal.signal(signal.SIGPIPE, signal.SIG_DFL) |
|
|
if hasattr(signal, 'SIGPIPE'): |
|
|
|
|
|
signal.signal(signal.SIGPIPE, signal.SIG_DFL) |
|
|
|
|
|
|
|
|
socketserver.TCPServer.allow_reuse_address = True |
|
|
socketserver.TCPServer.allow_reuse_address = True |
|
|
handler = functools.partial(SimpleHandler, rpc, snrpc) |
|
|
handler = functools.partial(SimpleHandler, rpc, snrpc) |
|
|
|
|
|
|
|
|
httpd = socketserver.TCPServer(("", args.port), handler) |
|
|
httpd = socketserver.TCPServer(("", args.port), handler) |
|
|
try: |
|
|
try: |
|
|
|
|
|
print(f"Serving HTTP at port {args.port} (http://localhost:{args.port}/) ...") |
|
|
httpd.serve_forever() |
|
|
httpd.serve_forever() |
|
|
except KeyboardInterrupt: |
|
|
except KeyboardInterrupt: |
|
|
return |
|
|
return |
|
|