feat: support sudp proxy (#1730)

This commit is contained in:
Tank
2020-04-22 21:37:45 +08:00
committed by GitHub
parent 6d78af6144
commit 4797136965
15 changed files with 669 additions and 1 deletions

View File

@@ -72,6 +72,12 @@ local_port = 10701
use_encryption = true
use_compression = true
[sudp]
type = sudp
sk = abcdefg
local_ip = 127.0.0.1
local_port = 10702
[web01]
type = http
local_ip = 127.0.0.1

View File

@@ -23,3 +23,12 @@ bind_addr = 127.0.0.1
bind_port = 10905
use_encryption = true
use_compression = true
[sudp_visitor]
type = sudp
role = visitor
server_name = sudp
sk = abcdefg
bind_addr = 127.0.0.1
bind_port = 10816

View File

@@ -118,6 +118,16 @@ func TestStcp(t *testing.T) {
}
}
func TestSudp(t *testing.T) {
assert := assert.New(t)
// Normal
addr := fmt.Sprintf("127.0.0.1:%d", consts.TEST_SUDP_FRP_PORT)
res, err := util.SendUdpMsg(addr, consts.TEST_SUDP_ECHO_STR)
assert.NoError(err)
assert.Equal(consts.TEST_SUDP_ECHO_STR, res)
}
func TestHttp(t *testing.T) {
assert := assert.New(t)
// web01