Merge pull request #32 from methane/patch-1
Fix default Origin isn't URI
This commit is contained in:
@@ -57,9 +57,9 @@ class InteractiveConsole(code.InteractiveConsole):
|
||||
def main():
|
||||
args = parse_args()
|
||||
console = InteractiveConsole()
|
||||
ws = websocket.create_connection(args.url)
|
||||
if args.verbose > 1:
|
||||
websocket.enableTrace(True)
|
||||
ws = websocket.create_connection(args.url)
|
||||
print("Press Ctrl+C to quit")
|
||||
|
||||
def recv():
|
||||
@@ -106,5 +106,5 @@ def main():
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
@@ -432,7 +432,7 @@ class WebSocket(object):
|
||||
if "origin" in options:
|
||||
headers.append("Origin: %s" % options["origin"])
|
||||
else:
|
||||
headers.append("Origin: %s" % hostport)
|
||||
headers.append("Origin: http://%s" % hostport)
|
||||
|
||||
key = _create_sec_websocket_key()
|
||||
headers.append("Sec-WebSocket-Key: %s" % key)
|
||||
|
Reference in New Issue
Block a user