serjs / socks5-server

725 stars 174 forks source link

Not able to resolve container host name #30

Open myatmin opened 2 years ago

myatmin commented 2 years ago

Is it possible to resolve container host name?

services:
   proxy-socks5:
    container_name: proxy-socks5
    image: serjs/go-socks5-proxy:latest
    ports:
      - 1080:1080
  db:
    container_name: db-something
    image: ...

Able to curl --socks5 127.0.0.1:1080 <container ip and port> Not able to curl --socks5 127.0.0.1:1080 <container host name and port>

Environment: Docker version 20.10.14 on Windows with WSL2 enabled

serjs commented 1 year ago

Need more info. As far as I understand, you try to curl from proxy-socks5 container another container ip and port with success. If you have errors in name resolving to another container hostname from proxy-socks5 container, then check your docker network setup, you must be in the same docker network for source/target containers.

BTW, socks5-server use system DNS settings, make sure that host resolved from container itself.