fixed socketURL bug

This commit is contained in:
David Baldwynn 2017-03-27 17:44:28 -07:00
parent efe1bee190
commit 567e876cfd
No known key found for this signature in database
GPG key ID: 15D1C13202224A9B
5 changed files with 14 additions and 10 deletions

1
config/env/all.js vendored
View file

@ -21,6 +21,7 @@ module.exports = {
}, },
port: process.env.PORT || 3000, port: process.env.PORT || 3000,
socketPort: process.env.SOCKET_PORT || 20523,
templateEngine: 'swig', templateEngine: 'swig',

View file

@ -9,7 +9,6 @@ module.exports = {
pass: '' pass: ''
} }
}, },
socketPort: process.env.SOCKET_PORT || 20523,
log: { log: {
// Can specify one of 'combined', 'common', 'dev', 'short', 'tiny' // Can specify one of 'combined', 'common', 'dev', 'short', 'tiny'

View file

@ -1210,14 +1210,16 @@ angular.module('view-form').factory('Forms', ['$resource', 'VIEW_FORM_URL',
}; };
var url = ''; var url = '';
console.log("$window.socketPort: "+$window.socketPort);
console.log("$window.socketUrl: "+$window.socketUrl);
if($window.socketPort && $window.socketUrl){ if($window.socketPort && $window.socketUrl){
url = $window.socketUrl + ':' + $window.socketPort; url = window.location.protocol + '//' + $window.socketUrl + ':' + $window.socketPort;
} else if ($window.socketUrl && !$window.socketUrl){ } else if ($window.socketUrl && !$window.socketUrl){
url = $window.socketUrl; url = window.location.protocol + '//' + $window.socketUrl;
} else if ($window.socketPort){ } else if ($window.socketPort){
url = window.location.protocol+'//'+window.location.hostname + ':' + $window.socketPort; url = window.location.protocol + '//' + window.location.hostname + ':' + $window.socketPort;
} else { } else {
url = window.location.protocol+'//'+window.location.hostname; url = window.location.protocol + '//' + window.location.hostname;
} }
connect(url); connect(url);

File diff suppressed because one or more lines are too long

View file

@ -18,14 +18,16 @@
}; };
var url = ''; var url = '';
console.log("$window.socketPort: "+$window.socketPort);
console.log("$window.socketUrl: "+$window.socketUrl);
if($window.socketPort && $window.socketUrl){ if($window.socketPort && $window.socketUrl){
url = $window.socketUrl + ':' + $window.socketPort; url = window.location.protocol + '//' + $window.socketUrl + ':' + $window.socketPort;
} else if ($window.socketUrl && !$window.socketUrl){ } else if ($window.socketUrl && !$window.socketUrl){
url = $window.socketUrl; url = window.location.protocol + '//' + $window.socketUrl;
} else if ($window.socketPort){ } else if ($window.socketPort){
url = window.location.protocol+'//'+window.location.hostname + ':' + $window.socketPort; url = window.location.protocol + '//' + window.location.hostname + ':' + $window.socketPort;
} else { } else {
url = window.location.protocol+'//'+window.location.hostname; url = window.location.protocol + '//' + window.location.hostname;
} }
connect(url); connect(url);