Skip to content

Commit

Permalink
Merge pull request #128 from superhawk610/master
Browse files Browse the repository at this point in the history
Allow for hidden port 80
  • Loading branch information
alallier authored Jul 20, 2017
2 parents d1aa4e4 + f881363 commit 3aabaa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/reload-client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
(function refresh () {
var verboseLogging = false
var socketUrl = window.location.origin.replace() // This is dynamically populated by the reload.js file before it is sent to the browser
var socketUrl = window.location.origin
if (!window.location.origin.match(/:[0-9]+/)) {
socketUrl = window.location.origin + ':80'
}
socketUrl = socketUrl.replace() // This is dynamically populated by the reload.js file before it is sent to the browser
var socket

if (verboseLogging) {
Expand Down
2 changes: 1 addition & 1 deletion lib/reload.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = function reload (app, opts, server) {
if (verboseLogging) {
reloadCode = reloadCode.replace('verboseLogging = false', 'verboseLogging = true')
}
reloadCode = reloadCode.replace('window.location.origin.replace()', 'window.location.origin.replace(/(^http(s?):\\/\\/)(.*:)(.*)/,' + (socketPortSpecified ? '\'ws$2://$3' + socketPortSpecified : '\'ws$2://$3$4') + '\')')
reloadCode = reloadCode.replace('socketUrl.replace()', 'socketUrl.replace(/(^http(s?):\\/\\/)(.*:)(.*)/,' + (socketPortSpecified ? '\'ws$2://$3' + socketPortSpecified : '\'ws$2://$3$4') + '\')')

expressApp.get(route, function (req, res) {
res.type('text/javascript')
Expand Down

0 comments on commit 3aabaa9

Please sign in to comment.