Unverified Commit 0ec02b0c authored by Hendrik Liebau's avatar Hendrik Liebau Committed by GitHub

Add support for IPv6 in tests (#66285)

Using the hostname `::` enables dual-stack support. This prevents
`ECONNREFUSED` errors when running tests locally, and `localhost` being
resolved to `::1` (IPv6) instead of `127.0.0.1` (IPv4).
parent 0c7c4958
......@@ -34,7 +34,7 @@ async function main() {
process.exit(1)
})
server.listen(port, '0.0.0.0', () => {
server.listen(port, '::', () => {
console.log(`- Local: http://localhost:${port}`)
console.log(`- Next mode: ${dev ? 'development' : process.env.NODE_ENV}`)
})
......
......@@ -52,7 +52,7 @@ export function initNextServerScript(
'node',
[...((opts && opts.nodeArgs) || []), '--no-deprecation', scriptPath],
{
env,
env: { HOSTNAME: '::', ...env },
cwd: opts && opts.cwd,
}
)
......@@ -434,12 +434,11 @@ export function launchApp(
dir,
'-p',
port as string,
'--hostname',
'::',
].filter(Boolean),
undefined,
{
...options,
turbo: useTurbo,
}
{ ...options, turbo: useTurbo }
)
}
......@@ -484,10 +483,11 @@ export function nextStart(
port: string | number,
opts: NextDevOptions = {}
) {
return runNextCommandDev(['start', '-p', port as string, dir], undefined, {
...opts,
nextStart: true,
})
return runNextCommandDev(
['start', '-p', port as string, '--hostname', '::', dir],
undefined,
{ ...opts, nextStart: true }
)
}
export function buildTS(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment