| 930 | 930 | const [hasIPv6, hasIPv4] = await getHasIP(); |
| 931 | 931 | if (enableIPv6 === 'auto') { |
| 932 | 932 | useIPv6 = hasIPv6; |
| 933 | + } |
| 934 | + if (hasIPv6) { |
| 933 | 935 | if (useIPv6) { |
| 934 | 936 | console.log(color.green('IPv6 support detected')); |
| 937 | + } else { |
| 938 | + console.log('IPv6 support detected'); |
| 935 | 939 | } |
| 936 | | - } else if (hasIPv6) { |
| 937 | | - console.log('IPv6 support detected'); |
| 938 | 940 | } |
| 939 | 941 | |
| 942 | + |
| 940 | 943 | if (enableIPv4 === 'auto') { |
| 941 | 944 | useIPv4 = hasIPv4; |
| 942 | 945 | if (useIPv4) { |
| 943 | 946 | console.log(color.green('IPv4 support detected')); |
| 944 | 947 | } |
| 945 | | - } else if (hasIPv4) { |
| 948 | + } |
| 946 | | - console.log('IPv4 support detected'); |
| 949 | + if (hasIPv4) { |
| 950 | + if (useIPv4) { |
| 951 | + console.log(color.green('IPv4 support detected')); |
| 952 | + } else { |
| 953 | + console.log('IPv4 support detected'); |
| 954 | + } |
| 947 | 955 | } |
| 948 | 956 | |
| 957 | + |
| 949 | 958 | if (enableIPv6 === 'auto' && enableIPv4 === 'auto') { |
| 950 | 959 | if (!hasIPv6 && !hasIPv4) { |
| 951 | 960 | console.error('Both IPv6 and IPv4 are not detected'); |
| 952 | 961 | process.exit(1); |
| 953 | 962 | } |
| 954 | 963 | } |
| 955 | 964 | |
| 956 | 965 | if (!useIPv6 && !useIPv6) { |
| 957 | 966 | console.error('Both IPv6 and IPv4 are disabled,\nP.S. you should never see this error, at least at one point it was checked for before this, with the rest of the config options'); |
| 958 | 967 | process.exit(1); |
| 959 | 968 | } |
| 960 | 969 | |
| 961 | 970 | const [v6Failed, v4Failed] = await startHTTPorHTTPS(useIPv6, useIPv4); |