Skip to content

Commit

Permalink
Merge pull request #3453 from ivanov/fix-3447
Browse files Browse the repository at this point in the history
fix websocket connection in old Firefox

location.origin is a too recent addition.

closes #3447
  • Loading branch information
minrk committed Jun 21, 2013
2 parents 20c70fc + 81a88be commit dfb3be0
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -104,7 +104,9 @@ var IPython = (function (IPython) {
this.kernel_id = json.kernel_id;
var ws_url = json.ws_url;
if (ws_url.match(/wss?:\/\//) == null) {
ws_url = "ws" + location.origin.substr(4) + ws_url;
// trailing 's' in https will become wss for secure web sockets
prot = location.protocol.replace('http', 'ws') + "//";
ws_url = prot + location.host + ws_url;
};
this.ws_url = ws_url;
this.kernel_url = this.base_url + "/" + this.kernel_id;
Expand Down

0 comments on commit dfb3be0

Please sign in to comment.