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

public option doesn't allow explicitly to set protocol #1116

Closed
1 of 2 tasks
robertaistleitner opened this issue Sep 26, 2017 · 2 comments
Closed
1 of 2 tasks

public option doesn't allow explicitly to set protocol #1116

robertaistleitner opened this issue Sep 26, 2017 · 2 comments

Comments

@robertaistleitner
Copy link
Contributor

  • Operating System: irrelevant
  • Node Version: irrelevant
  • NPM Version: irrelevant
  • webpack Version: 3.6.0
  • webpack-dev-server Version: 2.8.2
  • This is a feature request
  • This is a bug

Code

// webpack.config.js
config.devServer = {
  ...,
  inline: true,
  public: 'https://dev.local/sockjs-node',
  publicPath: 'https://dev.local/'
};

Expected Behavior

I'm injecting an entrypoint to a iframe which has about:blank as source so that I have full control of injected DOM elements from the parent window. Problem is that therefore window.location.protocol has about: as value, which is obviously not https: as the parent window. I tried to force the socket url by using the public parameter in the options but it's missing support to force the protocol in the URL as well.

Actual Behavior

Protocol in public option is not supported (it's infered from the https property). Since I'm utilizing a nginx reverse proxy which does the https stuff, I don't want to enable the https options in dev-server.

For Bugs; How can we reproduce the behavior?

I'll create a PR in a few minutes which should show what's the problem and provide a fix for it..

@robertaistleitner robertaistleitner changed the title public option doesn't allow explicitly set protocol public option doesn't allow explicitly to set protocol Sep 26, 2017
@shellscape
Copy link
Contributor

FWIW this isn't a bug, the behavior is by design so it really doesn't qualify as a bug. Rather, this is a request for a modification of the current behavior. I'll update the issue template to provide for that option in the future.

I'll create a PR in a few minutes which should show what's the problem and provide a fix for it..

Your PR didn't really explain what the problem here is, but we can infer the issue in code from the PR changeset. This issue is kind of all over the place. The bit about about:blank doesn't provide a whole lot of context but...

I tried to force the socket url by using the public parameter in the options but it's missing support to force the protocol in the URL as well.

...is where the meat of this issue lies. I'll header over to your PR (#1117) and continue the discussion. Moving forward, if you're planning on creating a PR immediately after your issue, you can skip the issue and just add all info to the PR.

@shellscape
Copy link
Contributor

Closed in #1117

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

No branches or pull requests

2 participants