snail007 / goproxy

🔥 Proxy is a high performance HTTP(S) proxies, SOCKS5 proxies,WEBSOCKET, TCP, UDP proxy server implemented by golang. Now, it supports chain-style proxies,nat forwarding in different lan,TCP/UDP port forwarding, SSH forwarding.Proxy是golang实现的高性能http,https,websocket,tcp,socks5代理服务器,支持内网穿透,链式代理,通讯加密,智能HTTP,SOCKS5代理,黑白名单,限速,限流量,限连接数,跨平台,KCP支持,认证API。
https://snail007.host900.com/goproxy/manual/zh/
GNU General Public License v3.0
15.86k stars 3.02k forks source link

WARN unknown address , request from #493

Open zzsoszz opened 2 years ago

zzsoszz commented 2 years ago

使用config-prod这种非标准域名格式无法解析ip. 使用config-prod.com可以正常解析和返回页面。

Expected Behavior

期望可以config-prod可以解析成ip,并成功返回页面.

Current Behavior

$ curl http://config-prod:3000 -x 127.0.0.1:8888 curl: (52) Empty reply from server

Possible Solution

Context (Environment)

  1. proxy version is : proxy-linux-amd64
  2. full command is :
    
    $ vi /etc/hosts
    127.0.0.1 config-prod

$ ./proxy http -t tcp -p :8888

$ curl http://config-prod:3000 -x 127.0.0.1:8888 curl: (52) Empty reply from server

3. system is : ubuntu 
4. full log is: 

2022/07/17 18:55:15.413854 INFO GET:http://config-prod:3000/ 2022/07/17 18:55:15.413896 WARN unknown address , request from: 127.0.0.1:56412 2022/07/17 18:55:39.586027 INFO GET:http://config-prod:3000/ 2022/07/17 18:55:39.586100 WARN unknown address , request from: 127.0.0.1:58278 2022/07/17 18:55:59.188942 INFO GET:http://config-prod:3000/ 2022/07/17 18:55:59.188991 WARN unknown address , request from: 127.0.0.1:59224

HectorB-2020 commented 8 months ago

@zzsoszz & @snail007, hello! I'm afraid we are facing the same issue but on Windows. Unfortunately this is not only a warning, traffic is not passed if such addresses are requested. It turns out that proxy doesn't respect short hostnames in HTTP GET/POST even if they properly come from /etc/hosts or explicitly added as a command line parameter. Other commands like ping are certainly able to use these hostnames.

Can anybody tell me if there are plans to address this issue?

snail007 commented 8 months ago

the domain must be contains one dot .