I am developing an application in electronJS to run in Linux environment. It was working on old version of SLES15 SP4. When I upgraded the OS to SELES 15 SP5. I can see electron code is not able to call RES endpoint.
Description about issue:
Electron code is making REST call to endpoint http://localhost:8080/v1/myapp.
It seems localhost is mapped to ::1 ipv6 IP. Which is causing issue.
Error log snippet: Error: connect ECONNREFUSED ::1:8082
content of /etc/hosts file:
# cat /etc/hosts
127.0.0.1 localhost
::1 localhost ipv6-localhost ipv6-loopback
Now My question is why localhost is mapping to ::1 and not to 127.0.0.1. while the same code was working fine in old version OS with same content in /etc/hosts file.
NOTE: If you will comment line ::1 localhost ipv6-localhost ipv6-loopback in /etc/hosts file it will start working. But my requirement is to make it work with same content in /etc/hosts file.