Skip to content

Fix Socket Port option#1683

Open
glingy wants to merge 1 commit into
BrowserSync:masterfrom
glingy:patch-1
Open

Fix Socket Port option#1683
glingy wants to merge 1 commit into
BrowserSync:masterfrom
glingy:patch-1

Conversation

@glingy

@glingy glingy commented Apr 30, 2019

Copy link
Copy Markdown

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 with fixed external port). With quick testing, this seems to allow the socket.port option to change the port the socket connects to from the client.

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).
@glingy

glingy commented Apr 30, 2019

Copy link
Copy Markdown
Author

Note: helps issue #505 or at least improves the situation. I realize that in a docker container, this does not help much, but it is very helpful in other situations where browser-sync is behind a proxy.

@glingy glingy changed the title Fixed Socket Port option Fix Socket Port option Apr 30, 2019
@davidwindell

davidwindell commented Jun 1, 2020

Copy link
Copy Markdown

This would be really great and would fix the problem I described in #419, @shakyShane could you, @crlang44 or another maintainer review this? Many thanks!

@crlang44

crlang44 commented Jun 1, 2020

Copy link
Copy Markdown

I would certainly be surprised if I was a maintainer on this repo. Where do you see that?

@davidwindell

Copy link
Copy Markdown

Ah, it was on #1736, I must have mistook your acceptance of the review changes as being a maintainer

@davidwindell

Copy link
Copy Markdown

We couldn't wait for this so we've added a post-install script with sed to apply the patch:

"postinstall": "sed -i 's/var port = options/var port = socketOpts.port || options/g' node_modules/browser-sync/dist/connect-utils.js"

Works great!

@davidwindell

Copy link
Copy Markdown

@shakyShane any chance of getting this one merged?

@shakyShane

Copy link
Copy Markdown
Contributor

I'd like to get this fixed, looking for a simple reproduction :)

@glingy

glingy commented Dec 27, 2023

Copy link
Copy Markdown
Author

It's been too long, I don't have a reproduction anymore and barely remember this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants