Node.js server fails to bind on ipv6 if ipv4 is not available
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 122k
- Forks
- 37.3k
- Merge medio
- 4 d 2 h
- PR fusionados (30 d)
- 283
Descripción
Version
v24.18.1
Platform
Linux ssh2 6.18.43-alwaysdata #1 SMP PREEMPT_DYNAMIC Fri Aug 7 07:39:43 UTC 2026 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
- Run a HTTP server (code below)
- Try to connect to it (via e.g. python, netcat, a browser etc.)
code:
const http = require("http");
const server = http.createServer((req,res)=>{
res.writeHead(200, "Content-Type", "text/plain");
res.write("ok");
res.end();
});
server.listen({ port: 8300 }, ()=> {
console.log("Server is running");
});
I also tried all the following:
server.listen({ port: 8300, host: "::" }, ()=> {
console.log("Server is running");
});
server.listen({ port: 8300, host: "::", ipv6Only: true }, ()=> {
console.log("Server is running");
});
server.listen({ port: 8300, host: "", ipv6Only: true }, ()=> {
console.log("Server is running");
});
server.listen({ port: 8300, host: "0.0.0.0", ipv6Only: true }, ()=> {
console.log("Server is running");
});
server.listen({ port: 8300, host: "::1", ipv6Only: true }, ()=> {
console.log("Server is running");
});
server.listen({ port: 8300, host: "" }, ()=> {
console.log("Server is running");
});
server.listen(8300, "::", ()=> {
console.log("Server is running");
});
server.listen(8300, "", ()=> {
console.log("Server is running");
});
// maybe even more i forgot
How often does it reproduce? Is there a required condition?
TCPv4 must not be available on the OS.
For example, netstat -lntp must say this:
netstat: no support for `AF INET (tcp)' on this system.
netstat -lntp6 must not say that, however - instead, it should succeed:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
What is the expected behavior? Why is that the expected behavior?
The server should be accessible
What do you see instead?
No error is thrown or logged, however, I cannot connect to the server in any imaginable way
Additional information
edit: offensive comment removed by moderator
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza reproduciendo el problema con el servidor HTTP proporcionado y las variantes de listen en Linux sin compatibilidad con TCPv4; después, sigue la ruta de red de server.listen. Confirma la corrección verificando que un servidor IPv6-only sea accesible y que el comportamiento existente de listen siga siendo correcto en las pruebas de red relevantes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, node.js
- Área
- backend, networking
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 48/100