ahyatt/emacs-websocket — pull request #35 by weissjeffm (2014-07-30 18:19:27+00:00)
Title: Give the Origin header such that ipython's websocket accepts it

I'm not sure if this is "the right thing", but `ein` does not work properly anymore and this fixes it. The library that `ipython` uses for websockets (`tornado`) recently released 4.0 that seems to do stricter same-origin checking. Anyone running `pip` will get the latest `tornado` and `ein` will break.

http://www.tornadoweb.org/en/stable/releases/v4.0.0.html

So what I did was go into tornado's source and print out the `host` and `origin` data it was checking to make sure were equal, and changed websocket.el so that they were in fact equal.

I know little about websockets, so I could be wrong, but seems to me this will not be a security issue because emacs doesn't run remote untrusted code the way a browser does? So it shouldn't matter what websocket.el reports as the origin, since the origin should always be emacs and not some untrusted remote server.

I also don't know if this change will affect other libs that depend on websockets.