-
Notifications
You must be signed in to change notification settings - Fork 63
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
Emulator UI should not connect to 0.0.0.0 for emulators #286
Comments
@yuchenshi I would like to pick this up. As per my understanding, I think simply changing host to 127.0.0.1 in emulators would make it work. Please correct me if something else also needs to be done. |
@gautamsingal Of course! We welcome PRs addressing this. As noted in the last paragraph, please make sure to take care of both |
@yuchenshi Thanks! Picking this up |
@yuchenshi I tried but unable to do. Can you please guide me in this? |
I'm not sure if WSL2 is part of the official supported platforms but I was unable to get any host options working when they work fine elsewhere. Using a configuration like below should work, but the emulator UI and other front-end code can't connect. I would be happy to also help.
|
In server.js there are the lines Object.entries(emulators).forEach(([name, info]) => {
json[name] = {
hostAndPort: hostAndPort(info.host, info.port),
...info,
}
}); That host needs be checked for '0.0.0.0' and '::' If they are they should be changed to "localhost". All this logic is done using json so it makes it a bit more tricky. I tried doing it quickly, but got stuck getting the development environment going in windows. I was getting an SCSS error about material/theme/mixins and dind't have time to work through it. |
Description: - Added check whether info.host is not 0.0.0.0 or :: - If it is present, then update the host with localhost else it remains same - Pass the new value to hostAndPort
Description: - Added check whether info.host is not 0.0.0.0 or :: - If it is present, then update the host with localhost else it remains same - Pass the new value to hostAndPort
@blastdan Thanks for the feedback! |
@blastdan Was it a issue with
|
Description: - Added check whether info.host is not 0.0.0.0 or :: - If it is present, then update the host with localhost else it remains same - Pass the new value to hostAndPort
Fixed by #312. This will be included in the next release. |
@yuchenshi Is there any way to track when a new release is made? Thanks! |
@blastdan Yes! The Emulator UI releases with the Firebase CLI, so you can head to https://github.com/firebase/firebase-tools and click on the Watch dropdown menu and select "Releases only". GitHub will notify you if there is a new release to the Firebase CLI. This will be likely included in the next one or two Firebase CLI versions. |
FYI, this went out with Firebase CLI v8.6.0. |
I am still getting this error using an event listener on the realtime database emulator. See Chrome console errors: firebase.json says: firebase -V says |
…l (security rules) and on the emulator (right IPs - firebase/firebase-tools-ui#286 (comment))
…l (security rules) and on the emulator (right IPs - firebase/firebase-tools-ui#286 (comment))
this breaks firebase/firebase-tools#1898 |
In
firebase.json
, it is possible to specify0.0.0.0
forhost
for each emulator. This tells an emulator to listen on all IPv4 interfaces (including127.0.0.1
, the device's public network IP, etc.).However, with this setup, the Emulator UI attempts to send requests
http://0.0.0.0:8080
to reach Firestore in the Firestore viewer. This is invalid since0.0.0.0
is a non-routable address but some browsers / platforms (such as Chrome on Linux) special cases it to mean the same as127.0.0.1
. On other browsers / platforms (such as Chrome on Windows), this fails with errors likenet::ERR_ADDRESS_INVALID
.Instead, the Emulator UI should change it to
127.0.0.1
when constructing the URL. Similarly, the Emulator UI should connect to::1
(IPv6 local) when::
(IPv6 zero) is specified.The text was updated successfully, but these errors were encountered: