[GH-ISSUE #1189] 自己摸索出来的绑定多个HTTP端口的办法,无需二级域名,简洁明了。 #932

Closed
opened 2026-05-05 12:35:33 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @wmailn on GitHub (Apr 9, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1189

之前因为我是DDNS方式绑定的动态官网,没有二级域名,无法按照传统的HTTP端口绑定的方式绑定多个HTTP端口,参见:https://github.com/fatedier/frp/issues/1151
另外还有类似的问题:https://github.com/fatedier/frp/issues/914
作者大神回复的均是需要二级域名,后来便死心了,直到昨天误打误撞,写错了,发现神奇的可以了!以下是我走过的弯路,错误的配置:

常规绑定HTTP端口如下:
[ZenTao]
type = http
local_port = 8080
custom_domains = xxxxxx.asuscomm.com
此时不可能再建立一个type是http的,会冲突

[Beta]
type = tcp
local_port = 8081
remote_port = 31281
这种直接把HTTP改为TCP的,是不可以使用的

下面才是真正的方法:

[Beta]
type = tcp
local_ip = 192.168.1.10(此处是你自己的IP)
local_port = 8081
remote_port = 31281

这样就可以了

猜测直接把HTTP指为TCP,协议不同无法解析成功,但是经过转发后,则间接实现了HTTP协议,还请各位大神分析下 原因

Originally created by @wmailn on GitHub (Apr 9, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1189 之前因为我是DDNS方式绑定的动态官网,没有二级域名,无法按照传统的HTTP端口绑定的方式绑定多个HTTP端口,参见:https://github.com/fatedier/frp/issues/1151 另外还有类似的问题:https://github.com/fatedier/frp/issues/914 作者大神回复的均是需要二级域名,后来便死心了,直到昨天误打误撞,写错了,发现神奇的可以了!以下是我走过的弯路,错误的配置: ``` 常规绑定HTTP端口如下: [ZenTao] type = http local_port = 8080 custom_domains = xxxxxx.asuscomm.com 此时不可能再建立一个type是http的,会冲突 [Beta] type = tcp local_port = 8081 remote_port = 31281 这种直接把HTTP改为TCP的,是不可以使用的 ``` **下面才是真正的方法:** ``` [Beta] type = tcp local_ip = 192.168.1.10(此处是你自己的IP) local_port = 8081 remote_port = 31281 ``` 这样就可以了 猜测直接把HTTP指为TCP,协议不同无法解析成功,但是经过转发后,则间接实现了HTTP协议,还请各位大神分析下 原因
Author
Owner

@wmailn commented on GitHub (Apr 9, 2019):

Before because I'm a DDNS way binding dynamic website, there is no secondary domain name, not according to the traditional way of HTTP port binding binding multiple HTTP port, see: https://github.com/fatedier/frp/issues/1151
There are also similar issues: https://github.com/fatedier/frp/issues/914
What the author great god replies is to need 2 class domain name, gave up heart later, hit by accident by accident until yesterday bump into, write wrongly, discovery is magical ok!Here are the detours and misconfigurations I took:

The general binding HTTP port is as follows:
[ZenTao]
type = http
local_port = 8080
custom_domains = xxxxxx.asuscomm.com
At this point, it is impossible to establish a type is HTTP, will conflict

[Beta]
type = tcp
local_port = 8081
remote_port = 31281
This direct change of HTTP to TCP, is not available

here's the real way:

[Beta]
type = tcp
local_ip = 192.168.1.10(here is your own IP)
local_port = 8081
remote_port = 31281

That's it
Guess the direct refers to HTTP as TCP, different protocols can not be successfully resolved, but after the forwarding, the HTTP protocol is indirectly realized, also please analyze the reason

<!-- gh-comment-id:481309086 --> @wmailn commented on GitHub (Apr 9, 2019): Before because I'm a DDNS way binding dynamic website, there is no secondary domain name, not according to the traditional way of HTTP port binding binding multiple HTTP port, see: https://github.com/fatedier/frp/issues/1151 There are also similar issues: https://github.com/fatedier/frp/issues/914 What the author great god replies is to need 2 class domain name, gave up heart later, hit by accident by accident until yesterday bump into, write wrongly, discovery is magical ok!Here are the detours and misconfigurations I took: ``` The general binding HTTP port is as follows: [ZenTao] type = http local_port = 8080 custom_domains = xxxxxx.asuscomm.com At this point, it is impossible to establish a type is HTTP, will conflict [Beta] type = tcp local_port = 8081 remote_port = 31281 This direct change of HTTP to TCP, is not available ``` **here's the real way:** ``` [Beta] type = tcp local_ip = 192.168.1.10(here is your own IP) local_port = 8081 remote_port = 31281 ``` That's it Guess the direct refers to HTTP as TCP, different protocols can not be successfully resolved, but after the forwarding, the HTTP protocol is indirectly realized, also please analyze the reason
Author
Owner

@wmailn commented on GitHub (Apr 9, 2019):

以上翻译来自于有道,如有错误,请参阅中文;
The above translation is from youdao. If there are any mistakes, please refer to Chinese.

<!-- gh-comment-id:481310237 --> @wmailn commented on GitHub (Apr 9, 2019): 以上翻译来自于有道,如有错误,请参阅中文; The above translation is from youdao. If there are any mistakes, please refer to Chinese.
Author
Owner

@wmailn commented on GitHub (Apr 9, 2019):

摸索出来后发现其实已经有人在类似的回答上回复了,只是当时没看懂... (lll¬ω¬)

https://github.com/fatedier/frp/issues/914#issuecomment-418986484

https://github.com/fatedier/frp/issues/914#issuecomment-420599218

https://github.com/fatedier/frp/issues/960#issuecomment-434168679

<!-- gh-comment-id:481312760 --> @wmailn commented on GitHub (Apr 9, 2019): 摸索出来后发现其实已经有人在类似的回答上回复了,只是当时没看懂... (lll¬ω¬) https://github.com/fatedier/frp/issues/914#issuecomment-418986484 https://github.com/fatedier/frp/issues/914#issuecomment-420599218 https://github.com/fatedier/frp/issues/960#issuecomment-434168679
Author
Owner

@ray1919 commented on GitHub (Sep 9, 2019):

文档的URL Routing不好用,这个方法好

<!-- gh-comment-id:529305741 --> @ray1919 commented on GitHub (Sep 9, 2019): 文档的URL Routing不好用,这个方法好
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#932
No description provided.