Skip to content
15 changes: 10 additions & 5 deletions src/components/common/EmulatorConfigProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ async function configFetcher(url: string): Promise<Config> {
// resolve it to IPv6 and connection may fail.
host = '127.0.0.1';
}
if (key == "firestore") {
// If we remapped the host, apply it to the websocket host too.
value.webSocketHost = value.host;
}
break;
} else if (listen.address === '::') {
port = listen.port;
Expand All @@ -242,21 +246,22 @@ async function configFetcher(url: string): Promise<Config> {
// Ditto for IPv6.
host = '::1';
}
if (key == "firestore") {
// If we remapped the host, apply it to the websocket host too.
value.webSocketHost = value.host;
}
break;
}
}


result[key as Emulator] = {
...value,
host,
port,
hostAndPort: hostAndPort(host, port),
};
}

if (result.firestore?.webSocketPort) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously you only remapped the webSocketPort if it was set, do you need to preserve this if statement?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's likely irrelevant (webSocketPort is always provided), but added it back in

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to bring this back?

// Apply the same `host` change above to the WebSocket server.
result.firestore.webSocketHost = result.firestore.host;
}
return result;
}

Expand Down
Loading