feat: support ipv6, close #16513
This commit is contained in:
parent
ef6448645e
commit
49df5559a1
|
|
@ -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,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ const getLocalhostAddress = () => {
|
|||
.filter((iface) => iface?.family === 'IPv4' && !iface.internal)
|
||||
.map((iface) => iface?.address)
|
||||
.filter(Boolean);
|
||||
address.push('[::]');
|
||||
return address;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue