diff --git a/tests/ci/auto_test_frpc.ini b/tests/ci/auto_test_frpc.ini index b8d90bf2..32fe3cbc 100644 --- a/tests/ci/auto_test_frpc.ini +++ b/tests/ci/auto_test_frpc.ini @@ -126,6 +126,14 @@ custom_domains = test6.frp.com host_header_rewrite = test6.frp.com header_X-From-Where = frp +[tcpmultiplexing] +type = tcp +# Unused +remote_port = 0 +local_ip = 127.0.0.1 +local_port = 10701 +custom_domains = tcpmulti1 + [wildcard_http] type = http local_ip = 127.0.0.1 diff --git a/tests/ci/auto_test_frps.ini b/tests/ci/auto_test_frps.ini index 8948c987..6b96c1e3 100644 --- a/tests/ci/auto_test_frps.ini +++ b/tests/ci/auto_test_frps.ini @@ -2,6 +2,7 @@ bind_addr = 0.0.0.0 bind_port = 10700 vhost_http_port = 10804 +vhost_tcp_port = 10806 log_level = trace token = 123456 allow_ports = 10000-20000,20002,30000-50000 diff --git a/tests/ci/normal_test.go b/tests/ci/normal_test.go index 4f976c81..d3f77805 100644 --- a/tests/ci/normal_test.go +++ b/tests/ci/normal_test.go @@ -212,6 +212,17 @@ func TestHttp(t *testing.T) { } } +func TestTcpMultiplexing(t *testing.T) { + assert := assert.New(t) + + conn, err := gnet.DialTcpByProxy(fmt.Sprintf("http://%s:%d", "127.0.0.1", consts.TEST_TCP_VHOST_FRP_PORT), "tcpmulti1") + 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) diff --git a/tests/consts/consts.go b/tests/consts/consts.go index 4e1c1a00..feee47c5 100644 --- a/tests/consts/consts.go +++ b/tests/consts/consts.go @@ -40,6 +40,8 @@ var ( TEST_HTTP_FOO_STR string = "http foo string: " + TEST_STR TEST_HTTP_BAR_STR string = "http bar string: " + TEST_STR + TEST_TCP_VHOST_FRP_PORT int = 10806 + TEST_STCP_FRP_PORT int = 10805 TEST_STCP_EC_FRP_PORT int = 10905 TEST_STCP_ECHO_STR string = "stcp type:" + TEST_STR