You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding a domain alias to 127.0.0.1, for example app.local, and running a server on WSL 2, the alias is not mapped to WSL network as it happens with localhost.
Windows build number: Microsoft Windows [Version 10.0.19042.685]
Your Distribution version: 20.04
Whether the issue is on WSL 2 and/or WSL 1: Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020
Steps to reproduce
Edit windows hosts file at c:\windows\system32\drivers\etc\hosts and add 127.0.0.1 app.local to the last line
Edit WSL2 hosts file at /etc/hosts and add 127.0.0.1 app.local to the last line
(Optional) Restart the computer so WSL hosts file will be automatically synced with windows'
Reopen a terminal window
Run a network server in a port (I'm using 3000 since I'm working with a react app).
Open https://localhost:3000/ in your browser. It will work
Open https://app.local:3000/ in your browser. It won't work
Expected behavior
You should be able to see your app/server
Actual behavior
The browser shows the ERR_CONNECTION_REFUSED error.
The text was updated successfully, but these errors were encountered:
When adding a domain alias to
127.0.0.1
, for exampleapp.local
, and running a server on WSL 2, the alias is not mapped to WSL network as it happens withlocalhost
.Look at both commands being ran:
hosts file setup:
I have to manage different cookies so one of my apps can't have
localhost
or it will conflict with the other app's cookies. This is fixed by running one of the apps usingapp.local:3000
since the cookies are then set separately to that domain. Also, Auth0 lock requires us to do that for local development: https://auth0.com/docs/authorization/user-consent-and-third-party-applications#skip-consent-for-first-party-applications.But I can't get it to work.
Environment
Steps to reproduce
c:\windows\system32\drivers\etc\hosts
and add127.0.0.1 app.local
to the last line/etc/hosts
and add127.0.0.1 app.local
to the last linehttps://localhost:3000/
in your browser. It will workhttps://app.local:3000/
in your browser. It won't workExpected behavior
You should be able to see your app/server
Actual behavior
The browser shows the
ERR_CONNECTION_REFUSED
error.The text was updated successfully, but these errors were encountered: