Merge pull request #32 from methane/patch-1

Fix default Origin isn't URI
This commit is contained in:
liris
2013-05-02 23:51:51 -07:00
2 changed files with 3 additions and 3 deletions

View File

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

View File

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