[GH-ISSUE #2054] 如何在客户端根据域名用不同的代理进行转发(类似pac除了支持direct外还能支持proxy) #1633

Closed
opened 2026-05-05 13:02:42 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @bjq on GitHub (Nov 5, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/2054

如何在客户端根据域名, 用指定不同的代理进行转发
类似代理设置文件pac, 除了能支持direct外, 还能支持proxy 转发

[hk-service]
type = https
custom_domains = hk-trn.xxx-express.com
host_header_rewrite = xxx-service.com
local_ip = xxx-serivce.com
local_port = 443
有否类似? proxy = ?参数
可通过访问http-proxy代理, 由代理转发到 xxx-serivce.com:443

或者
[hk-service]
type = http
custom_domains = hk-trn.xxx-express.com
plugin = http2https
plugin_local_addr = xxx-serivce.com:443
plugin_host_header_rewrite = xxx-service.com
有否类似? plugin_proxy ?参数
可通过访问http-proxy代理, 由代理转发到 xxx-serivce.com:443

是否有上述功能, 在穿透到内网以后, 使用内网设置的各区域代理服务器, 访问不同区域的API服务

Originally created by @bjq on GitHub (Nov 5, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/2054 如何在客户端根据域名, 用指定不同的代理进行转发 类似代理设置文件pac, 除了能支持direct外, 还能支持proxy 转发 [hk-service] type = https custom_domains = hk-trn.xxx-express.com host_header_rewrite = xxx-service.com local_ip = xxx-serivce.com local_port = 443 有否类似? proxy = ?参数 可通过访问http-proxy代理, 由代理转发到 xxx-serivce.com:443 或者 [hk-service] type = http custom_domains = hk-trn.xxx-express.com plugin = http2https plugin_local_addr = xxx-serivce.com:443 plugin_host_header_rewrite = xxx-service.com 有否类似? plugin_proxy ?参数 可通过访问http-proxy代理, 由代理转发到 xxx-serivce.com:443 是否有上述功能, 在穿透到内网以后, 使用内网设置的各区域代理服务器, 访问不同区域的API服务
gitea-mirror 2026-05-05 13:02:42 -06:00
Author
Owner

@Becods commented on GitHub (Nov 5, 2020):

可以通过编写插件
或者启用多个frpc实现
猜测优先级应该不会太高

<!-- gh-comment-id:722418296 --> @Becods commented on GitHub (Nov 5, 2020): 可以通过编写插件 或者启用多个frpc实现 猜测优先级应该不会太高
Author
Owner

@kingwilliam commented on GitHub (Nov 5, 2020):

可考虑 frp+haproxy

frp client:

[frp-haproxy]
type = tcp
local_ip = 127.0.0.1
local_port = 443
remote_port = 443

haproxy

bind *:443
acl sni01 req.ssl_sni -i w11.abc.com
acl sni02 req.ssl_sni -i w22.mno.com
<!-- gh-comment-id:722693306 --> @kingwilliam commented on GitHub (Nov 5, 2020): 可考虑 frp+haproxy frp client: ``` [frp-haproxy] type = tcp local_ip = 127.0.0.1 local_port = 443 remote_port = 443 ``` haproxy ``` bind *:443 acl sni01 req.ssl_sni -i w11.abc.com acl sni02 req.ssl_sni -i w22.mno.com ```
Author
Owner

@bjq commented on GitHub (Nov 6, 2020):

可以通过编写插件
或者启用多个frpc实现
猜测优先级应该不会太高

客户端转发访问的服务, 必须通过代理含用户名和密码才能访问到, 启用多个frpc无法在同机器上做到服务代理转发, 主程序上增加这个提供代理转发访问功能应该加几行代码就行.

写插件确实是个办法, 有推荐的插件源代码可以参考吗? 插件如何编译引用哪里可以查到相关资料?

<!-- gh-comment-id:722779487 --> @bjq commented on GitHub (Nov 6, 2020): > 可以通过编写插件 > 或者启用多个frpc实现 > 猜测优先级应该不会太高 客户端转发访问的服务, 必须通过代理含用户名和密码才能访问到, 启用多个frpc无法在同机器上做到服务代理转发, 主程序上增加这个提供代理转发访问功能应该加几行代码就行. 写插件确实是个办法, 有推荐的插件源代码可以参考吗? 插件如何编译引用哪里可以查到相关资料?
Author
Owner

@bjq commented on GitHub (Nov 6, 2020):

可考虑 frp+haproxy

frp client:

[frp-haproxy]
type = tcp
local_ip = 127.0.0.1
local_port = 443
remote_port = 443

haproxy

bind *:443
acl sni01 req.ssl_sni -i w11.abc.com
acl sni02 req.ssl_sni -i w22.mno.com

简单的转发用大多数工具都是可以的, 客户端转发访问的服务, 必须通过代理含用户名和密码才能访问到, 即需要根据域名特征修改主机头后通过代理转发服务

<!-- gh-comment-id:722783943 --> @bjq commented on GitHub (Nov 6, 2020): > 可考虑 frp+haproxy > > frp client: > > ``` > [frp-haproxy] > type = tcp > local_ip = 127.0.0.1 > local_port = 443 > remote_port = 443 > ``` > > haproxy > > ``` > bind *:443 > acl sni01 req.ssl_sni -i w11.abc.com > acl sni02 req.ssl_sni -i w22.mno.com > ``` 简单的转发用大多数工具都是可以的, 客户端转发访问的服务, 必须通过代理含用户名和密码才能访问到, 即需要根据域名特征修改主机头后通过代理转发服务
Author
Owner

@github-actions[bot] commented on GitHub (Dec 22, 2020):

Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.

<!-- gh-comment-id:749286291 --> @github-actions[bot] commented on GitHub (Dec 22, 2020): Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.
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#1633
No description provided.