gruntjs / grunt-contrib-connect

Start a static web server.
http://gruntjs.com
MIT License
714 stars 146 forks source link

IPv4 loopback overridden #283

Open TownCube opened 11 months ago

TownCube commented 11 months ago

Commit https://github.com/gruntjs/grunt-contrib-connect/commit/9fd73971031d39469f82e70282437a1e570b8f6a states

prefer IPv6 loopback when available (::) instead of IPv4 loopback (0.0.0.0), unless 0.0.0.0 is explicitly passed.

However this commit now always uses the IPv6 loopback even when the IPv4 loopback (0.0.0.0) is explicitly passed.

    if (!options.hostname || options.hostname === '*' || options.hostname === '0.0.0.0') {
      options.hostname = '::';
    }

This breaks IPv4 only environments with error:


Fatal error: listen EAFNOSUPPORT: address family not supported :::8081