Skip to content

Commit

Permalink
fix: get correct transport when running on default port
Browse files Browse the repository at this point in the history
This fixes capturing manual browsers on Cloud9.

Socket.io always uses port numbers in the active sockets map (even for default ports), so we need to append the port.

I also changed to always use "http", as Karma does not support https and Cloud9 does (it uses a proxy), so the main frame is https, but the socket.io connection runs on unsecured http.
  • Loading branch information
vojtajina committed Dec 7, 2013
1 parent ead8a77 commit 75ac1b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ var indexOf = function(collection, item) {
var getCurrentTransport = function() {
var parentWindow = window.opener || window.parent;
var location = parentWindow.location;
var hostname = location.protocol + '//' + location.host;
var hostname = 'http://' + location.host;

if (!location.port) {
hostname += ':80';
}

// Probably running in debug.html (there's no socket.io),
// or in debug mode with socket.io but no socket on this host.
Expand Down

0 comments on commit 75ac1b1

Please # to comment.