TCPMUX

了解 frp TCPMUX 类型的代理。

frp 支持将单个端口收到的连接路由到不同的代理,类似 vhost_http_portvhost_https_port

目前支持的复用器只有 httpconnect

当在 frps.ini[common] 中设置 tcpmux_httpconnect_port,frps 将会监听在这个端口,接收 HTTP CONNECT 请求。

frps 会根据 HTTP CONNECT 请求中的 host 路由到不同的后端代理。

示例配置如下:

# frps.ini
[common]
bind_port = 7000
tcpmux_httpconnect_port = 1337
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000

[proxy1]
type = tcpmux
multiplexer = httpconnect
custom_domains = test1
local_port = 80

[proxy2]
type = tcpmux
multiplexer = httpconnect
custom_domains = test2
local_port = 8080

通过上面的配置,frps 如果接收到 HTTP CONNECT 请求内容:

CONNECT test1 HTTP/1.1\r\n\r\n

该连接将会被路由到 proxy1 。

最后修改 July 20, 2023: update (485968d)