Reworked how new options are passed.

This commit is contained in:
Jose Vasconcellos
2015-03-01 19:11:44 -05:00
parent f77498309d
commit 95c14c11b5

View File

@@ -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():