0

I run a docker container using the network mode bridge. This container will then start a socket server on the port 25565 which has a port binding, in this case 30000. When I then connect from the host machine to this socket (45.13.227.228:30000 (45.13.227.228 is the ip of the host machine)) the connection is created. On the host machine the socket client has now for example the local address 45.13.227.228:47263 but in container the connected client's address is 172.17.0.1:39186. 172.17.0.1 is the gateway address of the default bridge network.

The problem now is, that on the container I need to know what the original address (in this example 45.13.227.228:47263) of the client is or I want the connection to maintain the original address when connecting from the host to the container.

Btw I cant just send the original address on the just created channel, as I don't directly control the socket server (It's controlled by a bungee cord server)

Edit: The same problem occurs when I want to connect from a container to a exposed port of another

anweisen
  • 1
  • 2
  • Does this answer your question? [How to get the IP address of the docker host from inside a docker container](https://stackoverflow.com/questions/22944631/how-to-get-the-ip-address-of-the-docker-host-from-inside-a-docker-container) – Noam Yizraeli Aug 20 '21 at 14:52

0 Answers0