Merge pull request #2615 from spotify/rugvip/ipvbork
backend-common: use localhost to fall back to IPv4 if IPv6 isn't available
This commit is contained in:
@@ -49,7 +49,10 @@ export class SingleHostDiscovery implements PluginEndpointDiscovery {
|
||||
// Translate bind-all to localhost, and support IPv6
|
||||
let host = listenHost;
|
||||
if (host === '::') {
|
||||
host = '::1';
|
||||
// We use localhost instead of ::1, since IPv6-compatible systems should default
|
||||
// to using IPv6 when they see localhost, but if the system doesn't support IPv6
|
||||
// things will still work.
|
||||
host = 'localhost';
|
||||
} else if (host === '0.0.0.0') {
|
||||
host = '127.0.0.1';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user