[GH-ISSUE #2145] Why logs "do http proxy request error: no such domain:"? #1709

Closed
opened 2026-05-05 13:05:48 -06:00 by gitea-mirror · 10 comments
Owner

Originally created by @GF-Huang on GitHub (Dec 9, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/2145

[REQUIRED] hat version of frp are you using

Version: 0.34.3

[REQUIRED] What operating system and processor architecture are you using
OS: client: Win10 + server: Centos 7.6 by docker compose
CPU architecture: x64

[REQUIRED] description of errors
I want to make my home computer acts a http proxy to access public internet. In other words, I use my home computer as a http proxy, so I can use my home IP address to do something.

confile

frps:

[common]
bind_port = 8080
vhost_http_port = 8080

frpc:

[common]
server_addr = mydomain.com
server_port = 8080

[http_proxy]
type = tcp
plugin = http_proxy
remote_port = 6000

docker-compose.yml

version: "3.3"
 
services:
  frps:
    restart: always
    container_name: frps
    image: snowdreamtech/frps:0.34.3
    volumes: 
      - ./frps.ini:/etc/frp/frps.ini
    network_mode: host

log file

frps:

frps    | 2020/12/09 17:26:34 [I] [service.go:190] frps tcp listen on 0.0.0.0:8080
frps    | 2020/12/09 17:26:34 [I] [service.go:232] http service listen on 0.0.0.0:8080
frps    | 2020/12/09 17:26:34 [I] [root.go:215] start frps success
frps    | 2020/12/09 17:26:40 [I] [service.go:444] [3f3465ca6799f43c] client login info: ip [220.114.*.*:*] version [0.34.3] hostname [] os [windows] arch [amd64]
frps    | 2020/12/09 17:26:40 [I] [tcp.go:63] [3f3465ca6799f43c] [http_proxy] tcp proxy listen port [6000]
frps    | 2020/12/09 17:26:40 [I] [control.go:446] [3f3465ca6799f43c] new proxy [http_proxy] success
frps    | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com 
frps    | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com 
frps    | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com 
frps    | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com 
frps    | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com 
frps    | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com

frpc:

2020/12/10 01:26:39 [I] [service.go:288] [3f3465ca6799f43c] login to server success, get run id [3f3465ca6799f43c], server udp port [0]
2020/12/10 01:26:39 [I] [proxy_manager.go:144] [3f3465ca6799f43c] proxy added: [http_proxy]
2020/12/10 01:26:39 [I] [control.go:180] [3f3465ca6799f43c] [http_proxy] start proxy success

Steps to reproduce the issue

  1. Setup as above my config
  2. Use any other client device set mydomain.com:8080 as http proxy, In my case I use my iPhone.
  3. Access baidu.com

Supplementary information

Can you guess what caused this issue

Checklist:

  • I included all information required in the sections above
  • I made sure there are no duplicates of this report (Use Search)
Originally created by @GF-Huang on GitHub (Dec 9, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/2145 <!-- From Chinese to English by machine translation, welcome to revise and polish. --> <!-- ⚠️⚠️ Incomplete reports will be marked as invalid, and closed, with few exceptions ⚠️⚠️ --> <!-- in addition, please use search well so that the same solution can be found in the feedback, we will close it directly --> <!-- for convenience of differentiation, use FRPS or FRPC to refer to the FRP server or client --> **[REQUIRED] hat version of frp are you using** <!-- Use ./frpc -v or ./frps -v --> Version: `0.34.3` **[REQUIRED] What operating system and processor architecture are you using** OS: `client: Win10` + `server: Centos 7.6 by docker compose` CPU architecture: `x64` **[REQUIRED] description of errors** I want to make my home computer acts a http proxy to access public internet. In other words, I use my home computer as a http proxy, so I can use my home IP address to do something. **confile** frps: ```ini [common] bind_port = 8080 vhost_http_port = 8080 ``` frpc: ```ini [common] server_addr = mydomain.com server_port = 8080 [http_proxy] type = tcp plugin = http_proxy remote_port = 6000 ``` docker-compose.yml ```yml version: "3.3" services: frps: restart: always container_name: frps image: snowdreamtech/frps:0.34.3 volumes: - ./frps.ini:/etc/frp/frps.ini network_mode: host ``` **log file** frps: ```log frps | 2020/12/09 17:26:34 [I] [service.go:190] frps tcp listen on 0.0.0.0:8080 frps | 2020/12/09 17:26:34 [I] [service.go:232] http service listen on 0.0.0.0:8080 frps | 2020/12/09 17:26:34 [I] [root.go:215] start frps success frps | 2020/12/09 17:26:40 [I] [service.go:444] [3f3465ca6799f43c] client login info: ip [220.114.*.*:*] version [0.34.3] hostname [] os [windows] arch [amd64] frps | 2020/12/09 17:26:40 [I] [tcp.go:63] [3f3465ca6799f43c] [http_proxy] tcp proxy listen port [6000] frps | 2020/12/09 17:26:40 [I] [control.go:446] [3f3465ca6799f43c] new proxy [http_proxy] success frps | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com frps | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com frps | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com frps | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com frps | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com frps | 2020/12/09 17:26:43 [W] [http.go:86] do http proxy request error: no such domain: www.baidu.com ``` frpc: ```log 2020/12/10 01:26:39 [I] [service.go:288] [3f3465ca6799f43c] login to server success, get run id [3f3465ca6799f43c], server udp port [0] 2020/12/10 01:26:39 [I] [proxy_manager.go:144] [3f3465ca6799f43c] proxy added: [http_proxy] 2020/12/10 01:26:39 [I] [control.go:180] [3f3465ca6799f43c] [http_proxy] start proxy success ``` **Steps to reproduce the issue** 1. Setup as above my config 2. Use any other client device set `mydomain.com:8080` as http proxy, In my case I use my iPhone. 3. Access `baidu.com` **Supplementary information** **Can you guess what caused this issue** **Checklist**: <!--- Make sure you've completed the following steps (put an "X" between of brackets): --> - [x] I included all information required in the sections above - [x] I made sure there are no duplicates of this report [(Use Search)](https://github.com/fatedier/frp/issues?q=is%3Aissue)
Author
Owner

@yuyulei commented on GitHub (Dec 10, 2020):

you make www.baidu.com (dns or /etc/hosts) resolved to the address of frps binding ? Then frps know nothing about www.baidu.com, because the domain is not in its configuration.

<!-- gh-comment-id:742200226 --> @yuyulei commented on GitHub (Dec 10, 2020): you make `www.baidu.com` (dns or /etc/hosts) resolved to the address of frps binding ? Then frps know nothing about `www.baidu.com`, because the domain is not in its configuration.
Author
Owner

@GF-Huang commented on GitHub (Dec 10, 2020):

you make www.baidu.com (dns or /etc/hosts) resolved to the address of frps binding ? Then frps know nothing about www.baidu.com, because the domain is not in its configuration.

No, I want the frpc acts a standard http proxy server, but it is behind NAT. Is this possible?

My intent is that using my home IP address to access some website when I'm not at home.

<!-- gh-comment-id:742217415 --> @GF-Huang commented on GitHub (Dec 10, 2020): > you make `www.baidu.com` (dns or /etc/hosts) resolved to the address of frps binding ? Then frps know nothing about `www.baidu.com`, because the domain is not in its configuration. No, I want the frpc acts a standard http proxy server, but it is behind NAT. Is this possible? My intent is that using my home IP address to access some website when I'm not at home.
Author
Owner

@yuyulei commented on GitHub (Dec 10, 2020):

frp has no plan to support "standard http proxy", because some tools(like nginx)is good enough.

for your purpose, your can try frpc + nginx, just handle nginx as a tcp service, ref: https://github.com/fatedier/frp#access-your-computer-in-lan-by-ssh.

<!-- gh-comment-id:742477562 --> @yuyulei commented on GitHub (Dec 10, 2020): frp has no plan to support "standard http proxy", because some tools(like nginx)is good enough. for your purpose, your can try frpc + nginx, just handle nginx as a tcp service, ref: https://github.com/fatedier/frp#access-your-computer-in-lan-by-ssh.
Author
Owner

@fatedier commented on GitHub (Dec 10, 2020):

@GF-Huang Try mydomain.com:6000

<!-- gh-comment-id:742486906 --> @fatedier commented on GitHub (Dec 10, 2020): @GF-Huang Try `mydomain.com:6000`
Author
Owner

@GF-Huang commented on GitHub (Dec 10, 2020):

@GF-Huang Try mydomain.com:6000

What the mean?

<!-- gh-comment-id:742488751 --> @GF-Huang commented on GitHub (Dec 10, 2020): > @GF-Huang Try `mydomain.com:6000` What the mean?
Author
Owner

@yuyulei commented on GitHub (Dec 10, 2020):

@GF-Huang Try mydomain.com:6000

What the mean?

"[http_proxy]" is tcp proxy, it make frps listens port: 6000 and put traffic to frpc's plugin: http_proxy.

"vhost_http_port" is for http proxy.

so the two will not share traffic, you just try

curl -x 'http://mydomain.com:6000' 'http://www.baidu.com'
<!-- gh-comment-id:742501739 --> @yuyulei commented on GitHub (Dec 10, 2020): > > @GF-Huang Try `mydomain.com:6000` > > What the mean? "[http_proxy]" is tcp proxy, it make frps listens port: 6000 and put traffic to frpc's plugin: http_proxy. "vhost_http_port" is for http proxy. so the two will not share traffic, you just try ``` curl -x 'http://mydomain.com:6000' 'http://www.baidu.com' ```
Author
Owner

@GF-Huang commented on GitHub (Dec 10, 2020):

What's the equivalent of the follow command in browser? I set proxy explicit in my browser. The ba***.top is my mydomain.com in above config.

curl -x 'http://mydomain.com:6000' 'http://www.baidu.com'

image

<!-- gh-comment-id:742503844 --> @GF-Huang commented on GitHub (Dec 10, 2020): What's the equivalent of the follow command in browser? I set proxy explicit in my browser. The `ba***.top` is my `mydomain.com` in above config. ``` curl -x 'http://mydomain.com:6000' 'http://www.baidu.com' ``` ![image](https://user-images.githubusercontent.com/4510984/101775174-08f6f680-3b2a-11eb-81f9-3b0bf10e7016.png)
Author
Owner

@yuyulei commented on GitHub (Dec 10, 2020):

What's the equivalent of the follow command in browser? I set proxy explicit in my browser. The ba***.top is my mydomain.com in above config.

curl -x 'http://mydomain.com:6000' 'http://www.baidu.com'

image

8080 -> 6000, use remote_port .

<!-- gh-comment-id:742509472 --> @yuyulei commented on GitHub (Dec 10, 2020): > What's the equivalent of the follow command in browser? I set proxy explicit in my browser. The `ba***.top` is my `mydomain.com` in above config. > > ``` > curl -x 'http://mydomain.com:6000' 'http://www.baidu.com' > ``` > > ![image](https://user-images.githubusercontent.com/4510984/101775174-08f6f680-3b2a-11eb-81f9-3b0bf10e7016.png) 8080 -> 6000, use `remote_port `.
Author
Owner

@GF-Huang commented on GitHub (Dec 10, 2020):

It works! Thank you all. 🌹

<!-- gh-comment-id:742510447 --> @GF-Huang commented on GitHub (Dec 10, 2020): It works! Thank you all. 🌹
Author
Owner

@GF-Huang commented on GitHub (Dec 10, 2020):

By the way, what difference between vhost_http_port and remote_port of [http_proxy]?

It's hard to understand.

<!-- gh-comment-id:742514573 --> @GF-Huang commented on GitHub (Dec 10, 2020): By the way, what difference between `vhost_http_port` and `remote_port` of `[http_proxy]`? It's hard to understand.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1709
No description provided.