Skip to content

use proxy can not hot update #600

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
beliefgp opened this issue Sep 8, 2016 · 11 comments · May be fixed by signal-noise/webpack-dev-server#9
Closed

use proxy can not hot update #600

beliefgp opened this issue Sep 8, 2016 · 11 comments · May be fixed by signal-noise/webpack-dev-server#9

Comments

@beliefgp
Copy link

beliefgp commented Sep 8, 2016

webpack: 1.10.x
webpack-dev-server: 1.15.x
OSX 10.x

// webpack-dev-server/lib/Server.js code
sockServer.installHandlers(this.listeningApp, {
     prefix: '/sockjs-node'
});

this prefix is unchangeable;
when i use browser proxy,request.url include hostname, it can not work.

example: local.com:2222/sockjs-node/info.js

not use proxy,it can matched an work
request.url = /sockjs-node/info.js

use proxy ,it can not matched
request.url = local.com:2222/sockjs-node/info.js

@SpaceK33z
Copy link
Member

So what would your proposed fix be? I'm not sure I understand what you're trying to do here.

@beliefgp
Copy link
Author

beliefgp commented Sep 8, 2016

the sockServer prefix can configurable or auto match current host

thanks。

@SpaceK33z
Copy link
Member

Is there an easy way to reproduce this behavior? I've never seen this before.

@beliefgp
Copy link
Author

beliefgp commented Sep 9, 2016

my local environment : chrome install SwitchyOmega , config : http 127.0.0.1 2222

then use webpack-dev-server

@SpaceK33z
Copy link
Member

Could you check if webpack/webpack-dev-middleware#80 works for you? The quickest way to test this would be to go to node_modules/webpack-dev-middleware/middleware.js, and copy/paste the new code.

@beliefgp
Copy link
Author

beliefgp commented Sep 9, 2016

I am sorry that not this. The same reason,but not one problem, but Sockjs on this scheme can be used。

@SpaceK33z
Copy link
Member

And is it not possible to exclude your dev domain from the proxy? SwitchyOmega seems to have an option for this:

switchyomega_options

@beliefgp
Copy link
Author

beliefgp commented Sep 9, 2016

It is my current solution。 I just want to make it more simple

@SpaceK33z
Copy link
Member

I think this is the way it should work, the dev server should not be proxied like that.

@beliefgp
Copy link
Author

beliefgp commented Sep 9, 2016

I agree, but it is complex ( configuration host,proxy, and exclude dev server ) when use proxy。
For new user, it is easy to forget.

Thank you anyway。

@SpaceK33z
Copy link
Member

Yeah I agree, the configuration of dev-server can be (too) complicated. We're working on that though, with stricter validation of the configuration.

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 a pull request may close this issue.

2 participants