TCPMUX

了解 frp TCPMUX 类型的代理。

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

目前支持的复用器只有 httpconnect

当在 frps.toml 中设置 tcpmuxHTTPConnectPort,frps 将会监听在这个端口,接收 HTTP CONNECT 请求。

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

示例配置如下:

# frps.toml
    bindPort = 7000
    tcpmuxHTTPConnectPort = 1337
    
# frpc.toml
    serverAddr = "x.x.x.x"
    serverPort = 7000
    
    [[proxies]]
    name = "proxy1"
    type = "tcpmux"
    multiplexer = "httpconnect"
    customDomains = ["test1"]
    localPort = 80
    
    [[proxies]]
    name = "proxy2"
    type = "tcpmux"
    multiplexer = "httpconnect"
    customDomains = ["test2"]
    localPort = 8080
    

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

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

该连接将会被路由到 proxy1 。

最后修改 November 15, 2023: fix 404 (#71) (626ce4d)

TCPMUX

Understand agents of type frpTCPMUX.

Frp supports routing connections received by a single port to different agents, similar to vhostHTTPPortandvhostHTTPSPort.

Currently, the only supported multiplexers arehttp connect

When set infrps. toml tcpmuxHTTPConnectPort, frps We will listen on this port to receive HTTP CONNECT requests.

FRPS will send the host route in the HTTP CONNECT request to different backend agents .

ExampleConfiguration如下:

# frps.toml
    bindPort = 7000
    tcpmuxHTTPConnectPort = 1337
    
# frpc.toml
    serverAddr = "x.x.x.x"
    serverPort = 7000
    
    [[proxies]]
    name = "proxy1"
    type = "tcpmux"
    multiplexer = "httpconnect"
    customDomains = ["test1"]
    localPort = 80
    
    [[proxies]]
    name = "proxy2"
    type = "tcpmux"
    multiplexer = "httpconnect"
    customDomains = ["test2"]
    localPort = 8080
    

If frps receives HTTP CONNECT through the above Configuration Request content:

CONNECT test1 HTTP/1.1 \ r \ n
                    

This connection will be routed to proxy1

Last modified November 15, 2023: fix 404 (#71) (626ce4d)