firebase-tools-ui: Emulator UI should not connect to 0.0.0.0 for emulators
In firebase.json
, it is possible to specify 0.0.0.0
for host
for each emulator. This tells an emulator to listen on all IPv4 interfaces (including 127.0.0.1
, the device’s public network IP, etc.).
{
// ...
"emulators": {
"firestore": {"host": "0.0.0.0", "port": 8080},
}
}
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 since 0.0.0.0
is a non-routable address but some browsers / platforms (such as Chrome on Linux) special cases it to mean the same as 127.0.0.1
. On other browsers / platforms (such as Chrome on Windows), this fails with errors like net::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.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 15 (9 by maintainers)
Commits related to this issue
- #286: Emulator UI should not connect to 0.0.0.0 for emulators 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... — committed to gautamsingal/firebase-tools-ui by gautamsingal 4 years ago
- #286: Emulator UI should not connect to 0.0.0.0 for emulators 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... — committed to gautamsingal/firebase-tools-ui by gautamsingal 4 years ago
- #286: Emulator UI should not connect to 0.0.0.0 for emulators 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... — committed to gautamsingal/firebase-tools-ui by gautamsingal 4 years ago
- various hackery to get my database events on the client to work at all (security rules) and on the emulator (right IPs - https://github.com/firebase/firebase-tools-ui/issues/286#issuecomment-868961742... — committed to arimwilson/Joydom by arimwilson 3 years ago
- various hackery to get my database events on the client to work at all (security rules) and on the emulator (right IPs - https://github.com/firebase/firebase-tools-ui/issues/286#issuecomment-868961742... — committed to arimwilson/Joydom by arimwilson 3 years ago
@moneal @blastdan I think it’s https://github.com/firebase/firebase-tools-ui/issues/210 – a known issue. However, we still haven’t found a great cross-platform solution and would appreciate any help there. Either way, let’s move the discussion there.
@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.