From 95c14c11b5b8f56fbed9a0b2bb78fadd4f17d10c Mon Sep 17 00:00:00 2001 From: Jose Vasconcellos Date: Sun, 1 Mar 2015 19:11:44 -0500 Subject: [PATCH] Reworked how new options are passed. --- bin/wsdump.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/wsdump.py b/bin/wsdump.py index 3f1d56e..d98d240 100755 --- a/bin/wsdump.py +++ b/bin/wsdump.py @@ -72,14 +72,15 @@ def main(): console = InteractiveConsole() if args.verbose > 1: websocket.enableTrace(True) - opts = {} + options = {} if (args.origin): - opts = { "origin": args.origin } + options["origin"] = args.origin if (args.subprotocols): - opts = { "subprotocols": args.subprotocols } + options["subprotocols"] = args.subprotocols + opts = {} if (args.nocert): opts = { "cert_reqs": websocket.ssl.CERT_NONE, "check_hostname": False } - ws = websocket.create_connection(args.url, sslopt=opts) + ws = websocket.create_connection(args.url, sslopt=opts, **options) print("Press Ctrl+C to quit") def recv():