From 94e97d89d7c5edffdd76c51560fc8cd60f28b6b5 Mon Sep 17 00:00:00 2001 From: glingy <17791817+glingy@users.noreply.github.com> Date: Mon, 29 Apr 2019 19:29:21 -0700 Subject: [PATCH] Fixed Socket Port option The socket port option documented in https://www.browsersync.io/docs/options/#option-socket did not affect anything. This allows the socket.port option to override the default port option so browser-sync can work in situations where the external port does not coincide with the internal port (ex: inside a docker container). --- packages/browser-sync/lib/connect-utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/browser-sync/lib/connect-utils.js b/packages/browser-sync/lib/connect-utils.js index dcc7c440e..18e4f1873 100644 --- a/packages/browser-sync/lib/connect-utils.js +++ b/packages/browser-sync/lib/connect-utils.js @@ -159,7 +159,7 @@ var connectUtils = { "'{protocol}' + location.hostname + ':{port}{ns}'"; var withHost = "'{protocol}' + location.host + '{ns}'"; var withDomain = "'{domain}{ns}'"; - var port = options.get("port"); + var port = socketOpts.port || options.get("port"); // default use-case is server/proxy var string = withHost;