Skip to content
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

WSL2 Binding issues - with LiveReload #5567

Open
1 task done
Brian-McBride opened this issue Feb 25, 2023 · 1 comment
Open
1 task done

WSL2 Binding issues - with LiveReload #5567

Brian-McBride opened this issue Feb 25, 2023 · 1 comment

Comments

@Brian-McBride
Copy link

What version of Remix are you using?

1.13.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

Using the basic installer (express), the server and the WebSocket service for LiveReload aren't accessible.
WebSocket

Expected Behavior

The ports would be accessible outside of the WSL2 environment.
The way to handle this according to Microsoft is to bind the services to 0.0.0.0 instead of localhost

For instance:

let wss = new WebSocket.Server({ port: config.devServerPort });

We can modify this line to be;

let wss = new WebSocket.Server({ port: config.devServerPort, host: '0.0.0.0' });

It would probably be even better to have something like;

let wss = new WebSocket.Server({ port: config.devServerPort, host: config.devServerHost' });

Then make the host an argument like --port

Actual Behavior

The code just binds on localhost by default. I just went into my node modules and slightly modified the code for my own personal fix. it is WSL2 issues though. The network bridge is not as clean as one might expect.

@github-actions github-actions bot added the needs-response We need a response from the original author about this issue/PR label Apr 26, 2023
@remix-run remix-run deleted a comment from github-actions bot Apr 30, 2023
@machour machour removed the needs-response We need a response from the original author about this issue/PR label Apr 30, 2023
@brophdawg11 brophdawg11 added this to v2 Aug 3, 2023
@brophdawg11 brophdawg11 moved this to Backlog in v2 Aug 3, 2023
@pcattori
Copy link
Contributor

pcattori commented Aug 4, 2023

With v2_dev, #6724 added the REMIX_DEV_ORIGIN env var that lets you configure this:

REMIX_DEV_ORIGIN="0.0.0.0/3003" remix dev --port 3003

That said, I'd be great to get this working without the need for you to configure the origin and match up the configured ports. Can you share a link to Microsoft's recommendation?

Also would 127.0.0.0 work instead of localhost? 0.0.0.0 is overly permissive for other use-cases.

@pcattori pcattori moved this from Backlog to In progress in v2 Aug 4, 2023
@pcattori pcattori moved this from In progress to Backlog in v2 Aug 4, 2023
@pcattori pcattori moved this from Backlog to In progress in v2 Aug 14, 2023
@pcattori pcattori removed this from v2 Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants