Allow overriding WDS protocol#13389
Conversation
For local development, [we](https://www.tonies.com/) are running many services in a docker-compose environment. One nginx instance listens to TCP 443 on the host, terminates TLS and speaks via HTTP with our react app. We can override `WDS_SOCKET_HOST` and `WDS_SOCKET_PORT` to get it to point it to the right virtual host and port. However, it tries to connect via `ws://`, rather than `wss://`, because this distinction is made during build time rather than runtime; ou rblunde.js looks like this: `__webpack_require__("./node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=rect-app.local.example.cloud&port=443&pathname=%2Fws&logging=none&reconnect=10");` Note `procotol=ws&hostname=...`, determined during build time. To fix this, add a new variable `WDS_SOCKET_PROTOCOL`, and pass it through.
|
Hi @phihag! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
I signed the CLA. |
For local development, we are running many services in a docker-compose environment. One nginx instance listens to TCP 443 on the host, terminates TLS and speaks via HTTP with our react app.
We can override
WDS_SOCKET_HOSTandWDS_SOCKET_PORTto get it to point it to the right virtual host and port.However, it tries to connect via
ws://, rather thanwss://, because this distinction is made during build time rather than runtime; ou rblunde.js looks like this:__webpack_require__("./node_modules/webpack-dev-server/client/index.js?protocol=ws%3A&hostname=rect-app.local.example.cloud&port=443&pathname=%2Fws&logging=none&reconnect=10");Note
procotol=ws&hostname=..., determined during build time.To fix this, add a new variable
WDS_SOCKET_PROTOCOL, and pass it through.