feat: support ipv6, close #16513

This commit is contained in:
DIYgod
2024-08-26 16:52:35 +08:00
parent ef6448645e
commit 49df5559a1
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ if (config.listenInaddrAny) {
const server = serve({
fetch: app.fetch,
hostname: config.listenInaddrAny ? undefined : '127.0.0.1',
hostname: config.listenInaddrAny ? '::' : '127.0.0.1',
port,
});
+1
View File
@@ -39,6 +39,7 @@ const getLocalhostAddress = () => {
.filter((iface) => iface?.family === 'IPv4' && !iface.internal)
.map((iface) => iface?.address)
.filter(Boolean);
address.push('[::]');
return address;
};