Skip to content

Allow relative sockjs URL #1525

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

Closed
trashpanda001 opened this issue Jun 8, 2018 · 4 comments
Closed

Allow relative sockjs URL #1525

trashpanda001 opened this issue Jun 8, 2018 · 4 comments

Comments

@trashpanda001
Copy link
Contributor

What problem does this feature solve?

I am using Nginx in development to terminate SSL and proxy to the dev-server (https://nginx/ => http://devserver:8080/) with devServer.public set appropriately, so I can use HTTPS/HTTP2 during development.

This had been working fine until beta16 commit:

2cbe373

which makes sockjs URL absolute with the wrong host/port, now in this case: https://10.0.1.6:8080/sockjs-node. Previously it was simply /sockjs-node.

I would like an option to either specify sockjsUrl explicitly OR an option to omit the protocol/host/port and just use the pathname /sockjs-node.

What does the proposed API look like?

module.exports = {
   devServer: {
      disableHostCheck: true,
      public: 'local.mox.cc',
      sockjsRelative: true, // OR
      sockjsUrl: '/sockjs-node'
   }
}
@trashpanda001
Copy link
Contributor Author

trashpanda001 commented Jun 8, 2018

I suppose building sockjsUrl from the devServer's public might work as well like //local.mox.cc/sockjs-node.

@yyx990803
Copy link
Member

/cc @jkzing

@JohnCampionJr
Copy link

JohnCampionJr commented Oct 2, 2018

I think this would be useful, not sure why we wouldn't want this to be able to be relative
Relative sockjsUrl would allow for HMR to work whether the app is loaded directly from the webpackdevserver or through a proxied server on a different port.

@sokolovstas
Copy link

@sickp How to use devServer.public to build relative url?

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

4 participants