Local server can use wrong address in multiple networks environment and localhost connect
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 940
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 160
Description
Server must return own address on client connection. If it connected by localhost then server will search first available network interface (non-loopback) to find real address. It can fail and return wrong interface/ip without started listener (socket listener on the port). So client can’t connect to it.
TODO:
* research and reproduce use case (multiple network interfaces: local + virtual, first interface must be unavailable for socket listening; serverAddress as 0.0.0.0, connect by localhost);
* fix the problem. Possible solution: find really running listeners and return from that list, not from first available network.
Workaround for users:
* open launcher-folder/mage/mage-server/config/config.xml in text editor and change serverAddress from 0.0.0.0 to 127.0.0.1
* restart server app and connect to it by address 127.0.0.1 instead localhost
And restart server app.
Related code:


Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.