mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 01:08:33 +00:00
Refactor: FullCone TPROXY Inbound & Socks Outbound
https://t.me/projectXray/116037
This commit is contained in:
parent
13ad3fddf6
commit
2da07e0f8a
5 changed files with 128 additions and 48 deletions
|
@ -20,14 +20,14 @@ func TestUDPEncoding(t *testing.T) {
|
|||
Address: net.IPAddress([]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6}),
|
||||
Port: 1024,
|
||||
}
|
||||
writer := &buf.SequentialWriter{Writer: NewUDPWriter(request, b)}
|
||||
writer := &UDPWriter{Writer: b, Request: request}
|
||||
|
||||
content := []byte{'a'}
|
||||
payload := buf.New()
|
||||
payload.Write(content)
|
||||
common.Must(writer.WriteMultiBuffer(buf.MultiBuffer{payload}))
|
||||
|
||||
reader := NewUDPReader(b)
|
||||
reader := &UDPReader{Reader: b}
|
||||
|
||||
decodedPayload, err := reader.ReadMultiBuffer()
|
||||
common.Must(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue