We are using Netopeer2 in Docker on Windows 10. It is running with “Call home” function enabled. Function makes server connect to a client socket. This works when we have both client and server running in docker.
However my actual problem is when I have a java program with a server socket running on my host ( 127.0.0.1). Socket listens on port 4334. See below.
$ netstat -a | grep 4334
TCP 127.0.0.1:4334 SE-00002119:0 LISTENING
Then I enable “call home” on Netopeer2 in Docker container but there is no connection to the socket listening on port 4334.
localhost:4334 on the host, is local to your host… and can not be seen from the container.
Try binding you service on the host to it’s ip (or 0.0.0.0) and configure the call home target to the host ip.
I know that for Linux containers running on Docker Desktop on Windows or Mac, the local host can be accessed via host.docker.internal instead of localhost.