[GH-ISSUE #248] Host Header 功能异常 #173

Closed
opened 2026-05-05 11:55:18 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @tldzyx on GitHub (Feb 6, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/248

主机要求域名为 http://localhost:35381/

没错这是ASP.NET MVC站点通过IIS Express开发调试


frpc配置文件

[x_web]
privilege_mode = true
type = http
local_ip = 127.0.0.1
local_port = 35381
host_header_rewrite = localhost
subdomain = mvc

结果怎么也打不开,通过抓包分析请求,内容是这样的

GET / HTTP/1.1
Host: localhost:.com:35381
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: zh-CN,zh;q=0.8,en;q=0.6

于是错误出现了
Host: localhost:.com:35381
本应替换成localhost的主机名替换成了localhost:.com

Originally created by @tldzyx on GitHub (Feb 6, 2017). Original GitHub issue: https://github.com/fatedier/frp/issues/248 **主机要求域名为 [http://localhost:35381/](javascript:)** 没错这是ASP.NET MVC站点通过IIS Express开发调试 --- **frpc配置文件** ``` [x_web] privilege_mode = true type = http local_ip = 127.0.0.1 local_port = 35381 host_header_rewrite = localhost subdomain = mvc ``` --- 结果怎么也打不开,通过抓包分析请求,内容是这样的 ``` GET / HTTP/1.1 Host: localhost:.com:35381 Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding: gzip, deflate, sdch Accept-Language: zh-CN,zh;q=0.8,en;q=0.6 ``` --- 于是错误出现了 `Host: localhost:.com:35381` 本应替换成**localhost**的主机名替换成了**localhost:.com**
gitea-mirror 2026-05-05 11:55:18 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@fatedier commented on GitHub (May 18, 2017):

还能提供 hostname, 请求的 URL 吗?

<!-- gh-comment-id:302506065 --> @fatedier commented on GitHub (May 18, 2017): 还能提供 hostname, 请求的 URL 吗?
Author
Owner

@tohitsugu commented on GitHub (May 22, 2017):

Use a public domain that always resolves to localhost, such as planetaryassaultsystem.com

<!-- gh-comment-id:303028921 --> @tohitsugu commented on GitHub (May 22, 2017): Use a public domain that always resolves to localhost, such as planetaryassaultsystem.com
Author
Owner

@tohitsugu commented on GitHub (Jul 16, 2017):

From: "Mailer" mailer-daemon@googlemail.com

On 7/16/17, fatedier notifications@github.com wrote:

Closed #248 via 4cc1663a5f.

--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/fatedier/frp/issues/248#event-1165655814

<!-- gh-comment-id:315637075 --> @tohitsugu commented on GitHub (Jul 16, 2017): From: "Mailer" <mailer-daemon@googlemail.com> On 7/16/17, fatedier <notifications@github.com> wrote: > Closed #248 via 4cc1663a5f9ce5c6f1db764a3799526221b92f09. > > -- > You are receiving this because you commented. > Reply to this email directly or view it on GitHub: > https://github.com/fatedier/frp/issues/248#event-1165655814
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#173
No description provided.