hahahrfool
|
ce735dbb99
|
修订udp代码; dial配置 添加 fullcone 选项;默认为非fullcone
现在整个程序均通过了go test, main 也可以正常运行了。
Relay_UDP 函数添加流量计数;
发现之前 Relay函数的流量计数 在main.go里参数传反了,导致实际上计数的是上传而不是下载,已修复
对fullcone的情况做了特别考量。MsgConn的 Close函数在fullcone时不能随便被调用。
因此我添加了一个 CloseConnWithRaddr(raddr Addr) error 方法,以及 Fullcone() bool 方法
在utils包的init部分使用 rand 随机种子
|
2022-04-08 20:31:59 +08:00 |
|
hahahrfool
|
447bd8749a
|
重构所有udp部分的代码! 摒弃了过去非常复杂的upd转发机制;
不再使用 UDP_Putter 等机制去转发udp,而是用一个 netLayer.MsgConn 结构
proxy.Server 和 proxy.Client 接口改动,
Client在握手udp时不再使用handshake方法, 而是用新的 EstablishUDPChannel 方法
Server 在 Handshake时会选择性返回两种接口,io.ReadWriteCloser 用于tcp, netLayer.MsgConn 用于 udp
此时vless、socks5、direct 的udp转发都已经成功经过了 go test 验证, 但是 main.go 还未修改。
|
2022-04-08 13:49:56 +08:00 |
|
hahahrfool
|
88f32208c3
|
修订代码、注释;试图解决所有udp不会关闭退出的问题;UDP_timeout设为3分钟
|
2022-04-05 16:13:48 +08:00 |
|
hahahrfool
|
b31557df14
|
大范围修订代码,以试图防止内存逃逸到堆;
|
2022-03-31 13:33:58 +08:00 |
|
hahahrfool
|
3fa75b181f
|
修订代码,注释;修复小bug
|
2022-03-30 19:54:16 +08:00 |
|
hahahrfool
|
f2adcdcd45
|
防止udp转发时被裸奔;修缮socks udp associate
修订代码,文档,示例
添加 NumErr 结构; 从 handshakeInserver_and_passToOutClient 函数 分离出一个 dialClient 函数。
在socks5包中添加 client.go 文件,以及三个udp相关的客户端请求udp函数
之前的udp associate代码被证明是有很多bug的,现在被我一一修复,并通过了 udp_test.go的测试。
|
2022-03-29 19:00:14 +08:00 |
|