logoalt Hacker News

threiwyesterday at 7:53 AM2 repliesview on HN

On one of my linux machines the "localhost:8080" did not work after new installation. It resolves to local ipv6 address, while server only listened on ipv4.

After this I go out of my way to disable, remove and nuke ipv6, out of every setup and deployment I do. Ipv6 is already quite complicated, but supporting TWO competing network stacks, with complicated pseudo compatibility, just multiplies unnecessary complexity!


Replies

eqvinoxyesterday at 8:05 AM

Or, you could've fixed your server's configuration. Probably would've been faster than to "disable, remove and nuke ipv6". In general, the mistake is that it says "0.0.0.0" or "0.0.0.0:8080" somewhere where it should really say "::" or "[::]:8080".

(IPv6 sockets by default accept IPv4 connections, unless you disable that either system-wide or on the specific socket.)

By the way, I do agree the colon was a really poor choice for separating the blocks, when it is also used to separate the port number.

show 1 reply
orevyesterday at 3:43 PM

What you seem to be misunderstanding is that your whole process of nuking IPv6 is more work than studying the issue for a few minutes and then listening on both protocols. Setting a service to listen on a port will use both IPv4 and IPv6 by default, and if yours isn’t means you’re probably already doing something wrong or also have other bugs.