mirror of
https://github.com/fatedier/frp.git
synced 2026-01-11 22:23:12 +00:00
tcp multiplexing over http connect tunnel
This commit is contained in:
@@ -126,6 +126,13 @@ custom_domains = test6.frp.com
|
||||
host_header_rewrite = test6.frp.com
|
||||
header_X-From-Where = frp
|
||||
|
||||
[tcpmuxhttpconnect]
|
||||
type = tcpmux
|
||||
multiplexer = httpconnect
|
||||
local_ip = 127.0.0.1
|
||||
local_port = 10701
|
||||
custom_domains = tunnel1
|
||||
|
||||
[wildcard_http]
|
||||
type = http
|
||||
local_ip = 127.0.0.1
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
bind_addr = 0.0.0.0
|
||||
bind_port = 10700
|
||||
vhost_http_port = 10804
|
||||
tcpmux_httpconnect_port = 10806
|
||||
log_level = trace
|
||||
token = 123456
|
||||
allow_ports = 10000-20000,20002,30000-50000
|
||||
|
||||
@@ -212,6 +212,17 @@ func TestHttp(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTcpMux(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
conn, err := gnet.DialTcpByProxy(fmt.Sprintf("http://%s:%d", "127.0.0.1", consts.TEST_TCP_MUX_FRP_PORT), "tunnel1")
|
||||
if assert.NoError(err) {
|
||||
res, err := util.SendTcpMsgByConn(conn, consts.TEST_TCP_ECHO_STR)
|
||||
assert.NoError(err)
|
||||
assert.Equal(consts.TEST_TCP_ECHO_STR, res)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWebSocket(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user