Skip to content

Allow overriding WDS protocol#13389

Open
phihag wants to merge 1 commit into
react:mainfrom
phihag:WDS_SOCKET_PROTOCOL
Open

Allow overriding WDS protocol#13389
phihag wants to merge 1 commit into
react:mainfrom
phihag:WDS_SOCKET_PROTOCOL

Conversation

@phihag
Copy link
Copy Markdown

@phihag phihag commented Sep 28, 2023

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_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.

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.
@facebook-github-bot
Copy link
Copy Markdown

Hi @phihag!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@phihag
Copy link
Copy Markdown
Author

phihag commented Sep 28, 2023

I signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants