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
|
dc16dba65d
|
修订文档; 将大部分Fatal的代码改为Error.
|
2022-04-07 18:18:14 +08:00 |
|
hahahrfool
|
88f32208c3
|
修订代码、注释;试图解决所有udp不会关闭退出的问题;UDP_timeout设为3分钟
|
2022-04-05 16:13:48 +08:00 |
|
hahahrfool
|
0afb00dbf1
|
修订代码, 在socks5转发udp到direct时添加timeout和close机制
默认 UDP_timeout 暂且设为2小时
给 UDPRequestWriter 加 CloseUDPRequestWriter 方法,专门用于这种情况
添加 UDP_Putter_Generator 接口,且direct实现了该接口
为 UDP_Pipe添加 Close机制
|
2022-04-05 14:28:37 +08:00 |
|
hahahrfool
|
dfecd89d14
|
添加dns功能; 解决grpc 悬垂链接问题;
该悬垂问题可能就是v2ray/xray的 “grpc断流问题”,已被本commit轻松搞定。
dns配置:
[dns]
servers = [
"udp://114.114.114.114:53" # 如果把该url指向我们dokodemo监听的端口,就可以达到通过节点请求dns的目的.
]
[dns.hosts] # 自己定义的dns解析
"www.myfake.com" = "11.22.33.44"
"www.myfake2.com" = "11.222.33.44"
一旦配置了dns项,则所有dns都会试图向默认dns服务器请求;
该功能尚不完善。
|
2022-04-01 00:26:35 +08:00 |
|
hahahrfool
|
b97e990b44
|
尝试引入zap包作为log包
|
2022-03-31 18:28:57 +08:00 |
|
hahahrfool
|
b31557df14
|
大范围修订代码,以试图防止内存逃逸到堆;
|
2022-03-31 13:33:58 +08:00 |
|
hahahrfool
|
f8ef685bdd
|
解决readv内存泄漏问题;解决转发时断连后的悬垂链接问题
在四点链接的情况下,我们只终端中间两点是不够的,要切三刀;
总之实践很简单,就是copy完成之后,要Close所有的链接
readv的话,系统readv数组和buffer不要在put进pool后相互引用
添加-bl 选项,可以自定义buf大小;注意越小可能越慢,建议buf大小保持在4k以上
添加-pp选项,可以生成cpu.pprof文件
修复其它小问题.
|
2022-03-31 01:32:58 +08:00 |
|
hahahrfool
|
4ece4b84dd
|
修订代码
|
2022-03-30 21:32:35 +08:00 |
|
hahahrfool
|
01d681f14f
|
修订代码,注释,示例
|
2022-03-29 21:58:23 +08:00 |
|
hahahrfool
|
b63b90400a
|
bump version->v1.1.0.3; minor improve
|
2022-03-29 19:11:17 +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 |
|
hahahrfool
|
81160e8db2
|
广泛修订代码, 注释
|
2022-03-28 22:07:18 +08:00 |
|
hahahrfool
|
8c6ed6377d
|
修订代码;将addr的赋值从各个proxy自己的方法中提出来
|
2022-03-23 18:54:38 +08:00 |
|
hahahrfool
|
5661c8737f
|
添加readv功能;给出测试数据;修订代码,注释;
toml 新增 app.noreadv项,命令行参数新增 -readv
默认readv是打开状态,可以选择性关闭。
|
2022-03-22 14:12:32 +08:00 |
|
hahahrfool
|
548675e002
|
添加自定义网络层功能;添加udp网络层支持
配置中,listen和dial中,可添加 network = "udp" 字段,不添加则默认tcp
|
2022-03-21 21:19:31 +08:00 |
|
hahahrfool
|
8a9ace5889
|
将udp相关代码从 proxy包移动至 netLayer包
|
2022-03-20 18:05:32 +08:00 |
|
hahahrfool
|
dbe499cc08
|
添加unique协议, 详情见wiki
|
2022-03-19 18:39:16 +08:00 |
|
hahahrfool
|
1eb6dfe164
|
移除config包,文件直接移动到proxy中
因为config包与proxy包耦合性实际上很强,说明实际上config就是应该属于proxy包的.
|
2022-03-19 16:53:11 +08:00 |
|
hahahrfool
|
250f6e8c5b
|
新增http代理Server端.修订代码,注释.CommonConf加了Extra字段
CommonConf加了这一行:Extra map[string]interface{} `toml:"extra"`
这样就可以兼容一切未来未知的格式了, 同时 proxy包的 ClientCreator和 ServerCreator接口
也相应改动了,不再需要传入 map.
|
2022-03-19 16:43:55 +08:00 |
|
hahahrfool
|
a890d39ac7
|
添加toml标准配置格式支持;重构配置相关的代码;修订文档
添加了path分流部分的go test,简单修订 GetRequestPATH_from_Bytes 函数
|
2022-03-18 19:09:02 +08:00 |
|
hahahrfool
|
902b0d7d34
|
将所有的使用log的地方通通加上LogLevel的判断.
LogLevel在上个commit就已经被移动到了utils包.
|
2022-03-17 08:35:43 +08:00 |
|
hahahrfool
|
c9cf683a58
|
将common包改名为utils, 因为common太长了
|
2022-03-17 08:11:56 +08:00 |
|
hahahrfool
|
405207bc56
|
将netLayer抽象出来,proxy.Addr现在变成netLayer.Addr
netLayer里包含关于 网络层 以及传输层 的各种定义.
这里为了添加 类似 v2simple的 common.Matcher的功能,特地抽象出来一个层.
而且增添了第一个外部依赖包,github.com/yl2chen/cidranger包.
|
2022-03-16 09:01:43 +08:00 |
|
hahahrfool
|
fa1c5db1ef
|
上一个commit修改了函数签名,不好,太笨,还是不改好
proxy.Server返回的 *bytes.Buffer只被用于Fallback,所以直接放到Fallback里就行
|
2022-03-16 08:19:09 +08:00 |
|
hahahrfool
|
861d5a74c5
|
添加fallback功能,修改了proxy.Server接口,修订文档
|
2022-03-16 04:16:19 +08:00 |
|
hahahrfool
|
e558ba21cf
|
初步实现 tls lazy encrypt 功能 (splice)
|
2022-03-11 14:06:55 +08:00 |
|
hahahrfool
|
009162cf40
|
first
|
2022-03-09 21:27:13 +08:00 |
|