Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct port for https reverse proxy #4293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qswinson
Copy link

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

New test cases have been added

Motivation / Use-Case

This solves #4292 where the port of the webpack dev server is used instead of the port from the location in https situations.

Breaking Changes

no breaking changes

Additional Info

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 16, 2022

CLA Signed

The committers are authorized under a signed CLA.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is breaking change and breaks URLs for local development

@qswinson
Copy link
Author

It is breaking change and breaks URLs for local development

Can you provide a test case for the test suite that you say is breaking so I can address it? All of the unit tests are passing. The current behavior is a breaking change from Webpack v4 and is preventing us from upgrading.

@alexander-akait
Copy link
Member

alexander-akait commented Feb 17, 2022

Because you fix it only for 0.0.0.0/etc, it is not valid fix, also other developers can use different ports for proxy, we don't know your proxied port and can't rely on location port (even more it is security problem), you can set https://webpack.js.org/configuration/dev-server/#websocketurl, in your case you can set port: 0, it will be auto -

socketURLPort = self.location.port;
, i.e. what you want

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.

None yet

2 participants