-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Using pow (virtual host proxy) causes websocket error #853
Comments
I find Having proper |
Does this other tool help? |
I did see that issue and mention of puma-dev (and mehserve) but TBH have not tried either one yet. To be clear, the request here is to be able to configure the websocket URL that the injected client uses. That ability would happen to work around Pow's lack of websocket support. |
I understand that the request is to allow configuration but this defeats the purpose and philosophy of Create React App. If you're happy configuring low-level things like this, using webpack directly might work better for you. On the other hand, if we can fix it for everyone without configuration, or if we can suggest better tooling to work with Create React App, we'll gladly do that. |
Fair enough. Do you think it makes more sense to force the hot-reload client to always use |
If you can send a PR I could take a look. |
But AFAIK, yes, we support specifying custom hostname for virtual hosts. |
I need to look into this, I found the line where the client uses |
I would really like to be able to override the hot-reload client address as well; in my case the index.html is actually hosted within a separate app (Dynamics CRM) potentially located on another machine but it would be convenient to be able to load the script bundle from the Webpack dev server on localhost during development. The tricky part with using hard-coded defaults (like |
I'm going to close this for lack of activity. If there are any specific PRs we could consider them. However this tool is not meant to cover all possible use cases: it's meant mostly as a starting point. So you should probably eject and use webpack directly if you need more control. |
After considering this more I think I agree, ejecting seems to make the most sense since the purpose is to provide defaults not a fully configurable framework. |
This is something I just found out I needed. It would be nice if at least it could match the host set in Note: I was able to get this working by also running a reverse web socket proxy, but it seemed to me that if the HOST is an option as an env variable, then shouldn't the websocket use that host? |
Send a PR if you can get it working ;-) |
Description
When using pow with create-react-app's dev server configuration, the dev server attempts to make a websocket connection via the virtual host (e.g. uses
window.location.hostname
.) Pow does not handle websocket proxying, thus the dev server client connection needs to be made directly tolocalhost:[dev server port]
.Observed behavior
The dev server websocket connection fails, resulting in the following browser console error:
after which it appears to fall back to the xhr long poll method.
Desired behavior
With the standard webpack dev server HMR setup one would configure the client URL for the websocket to use. e.g. in webpack.config.dev.js:
So while browsing the app at
foo.dev
the client websocket connection is made tolocalhost:9999
and everything is peachy. This is not currently possible withreact-dev-utils/webpackHotDevClient
meaning if a user wants to use create-react-app and pow together, they must either...react-dev-utils/webpackHotDevClient
for the standard dev tools HMR configuration, orFeature request: Add ability to specify the direct dev server URL in the client entrypoint similar to
'webpack-dev-server/client?http://localhost:9999'
.Environment
create-react-app version: 0.2.0
Reproducible Demo
The text was updated successfully, but these errors were encountered: