-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Bug report
When I'm using webpack-dev-server in CRA, the WebSocket request URL gets composed incorrectly, if I'm using /etc/hosts to map a domain to localhost for the dev purposes. The code: https://github.com/webpack/webpack-dev-server/blame/master/client-src/utils/createSocketURL.js#L132-:L142
Actual Behavior
Given the app is being accessed via https://app.localhost.dev through reverse proxy pointing to http://127.0.0.1:3000
When I'm starting a CRA app in dev mode
A websocket request is being made to wss://app.localhost.dev:3000/ws
Expected Behavior
Given the app is being accessed via https://app.localhost.dev through reverse proxy pointing to http://127.0.0.1:3000
When I'm starting a CRA app in dev mode
A websocket request is being made to wss://app.localhost.dev/ws
How Do We Reproduce?
- Configure etc hosts:
127.0.0.1 app.localhost.dev - Configure reverse proxy to forward requests from https://app.localhost.dev to http://127.0.0.1:3000. This can be done with Caddy (
brew install caddy,caddy run).Caddyfilefile:
app.localhost.dev {
tls internal
reverse_proxy 127.0.0.1:3000
}
Metadata
Metadata
Assignees
Labels
No labels