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
|
73e26386ec
|
修订文档,示例,代码
|
2022-04-08 08:24:04 +08:00 |
|
hahahrfool
|
6291babff3
|
修订代码, 示例, 优化quic,设最大多路复用路数 为 4路.
之前代码使用纯单路且stream上限为320个,idle时间为2小时
现在自己思考发现完全不合理。
单个session内存在的stream数量 越少性能越高
重构了quic部分的代码。
添加一种主动记录服务端能承受的最大stream数量的机制,每次建立新stream时都试图找到 stream最少的一条可用session。
这种缓存session的做法实际上类似 连接池技术。
修复一些小问题.
|
2022-04-07 22:31:29 +08:00 |
|
hahahrfool
|
dc16dba65d
|
修订文档; 将大部分Fatal的代码改为Error.
|
2022-04-07 18:18:14 +08:00 |
|
hahahrfool
|
2d384314f4
|
修订,重构代码, 修复dns的bug; 添加Dns的DoT功能.
修复dns配置中"特殊服务器" 无法被正确配置、使用的bug
将 proxy.Standard结构 移动到 项目根目录的 StandardConf.
将 proxy.AppConf, LoadTomlConfStr, LoadTomlConfFile 函数 移动到根目录
因为 StandardConf和 AppConf里包含很多App级别的配置, 不宜放到proxy子包中
将 proxy.RuleConf 移动到 netLayer
将 proxy.LoadRulesForRoutePolicy 移动到 netLayer
将 proxy.LoadDnsMachine 移动到 netLayer
在dnsquery失败后,会判断错误, 若发现是Read错误,则会试图重新拨号
|
2022-04-07 13:45:24 +08:00 |
|
hahahrfool
|
0f4acfb168
|
修订代码、配置、示例
|
2022-04-06 14:00:23 +08:00 |
|
hahahrfool
|
f6081cc8be
|
修订代码;添加【下载geosite文件】的交互命令,可自动通过节点下载
|
2022-04-05 19:08:44 +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
|
3a997a32bc
|
修订代码,示例;添加geosite分流,域名现已支持full,sub,regex,geosite,match
|
2022-04-05 08:59:26 +08:00 |
|
hahahrfool
|
59b9c0cb47
|
修订代码, 增加geosite源文件的读取和匹配的相关函数
|
2022-04-05 06:56:41 +08:00 |
|
hahahrfool
|
df58f0988d
|
修订代码,添加-v参数
|
2022-04-04 15:28:08 +08:00 |
|
hahahrfool
|
b66cf34d02
|
添加一个命令行参数, 改进route机制;修复空指针bug;详情如下
添加-nd参数,意思是nodownload,不自动下载任何数据文件
route配置项的 dialTag现在可以为一个string也可以为一个 []string,用于负载均衡
|
2022-04-04 13:08:03 +08:00 |
|
hahahrfool
|
88f9ce8958
|
修订文档,示例,代码; 将hy默认速率降至100;优化quic
|
2022-04-04 08:17:08 +08:00 |
|
hahahrfool
|
8a1c86b933
|
添加解析域名策略,0默认4先查ip4,6先查6;40只查ipv4,60只查ipv6
|
2022-04-03 21:56:01 +08:00 |
|
hahahrfool
|
d98aa53390
|
解决quic无法正确关闭子连接的问题.
|
2022-04-03 21:16:19 +08:00 |
|
hahahrfool
|
60329c2109
|
修复ipv6判断写反的bug,此bug恰巧会导致ipv6主机无法访问ipv6
|
2022-04-03 17:58:26 +08:00 |
|
hahahrfool
|
2b8d966909
|
修订代码
|
2022-04-03 17:10:25 +08:00 |
|
hahahrfool
|
2c9c993c11
|
修订文档、示例; 修复在windows上直连时readv闪退的bug;
这次在程序ctrl+C关闭时, 会主动Close所有的监听端口. 主要是被报告windows有时退出程序之后, 端口还是处于占用状态.
试图引进新的 Makefile_release 文件 以及新的workflow文件 来快速编译发布包
|
2022-04-03 14:32:23 +08:00 |
|
hahahrfool
|
d4c893e579
|
修订代码,修复一个尴尬bug导致域名无法拨号.
|
2022-04-03 07:19:29 +08:00 |
|
hahahrfool
|
765f0bb113
|
修订代码;将默认loglevel改为warn;提前判断本机是否具有ipv6;
|
2022-04-02 20:36:15 +08:00 |
|
hahahrfool
|
4a3e60846b
|
修订代码;现在开启交互模式或api server后,可不指定配置文件.
|
2022-04-02 15:33:24 +08:00 |
|
hahahrfool
|
61de69a32a
|
令编译打包使用xz; main加defer close;地址若错误也不fatal;
|
2022-04-02 12:47:56 +08:00 |
|
hahahrfool
|
a8654e198e
|
试图修复udp close无效的问题,可能导致 too many opened sockets.
|
2022-04-02 09:24:15 +08:00 |
|
hahahrfool
|
814bcb29f5
|
添加大量交互模式功能
为交互模式添加如下功能:生成uuid,生成随机tls证书,查询当前状态,交互式生成配置文件
|
2022-04-01 19:13:47 +08:00 |
|
hahahrfool
|
8ad0905ce9
|
feat:apiServer;修复生成的证书无法使用的问题;修复小bug
添加如下命令行参数
-i interactive mode (只是加了一个参数, 还未实现交互功能)
-ea enable api server
-spp api Server Path Prefix, must start with '/',默认值 /api
只有 -ea命令行参数给出后,才会运行api服务器
默认allstate 的api的url 为 https://127.0.0.1:48345/api/allstate
用到basic auth,用户名为admin
密码的toml配置是
[app]
admin_pass = "adfadfadfadfa"
修订 api草案
|
2022-04-01 17:52:18 +08:00 |
|
hahahrfool
|
e732ea3c3b
|
修订代码;修复loglevel为debug时失效问题;dns请求加锁,已经可用
|
2022-04-01 12:31:47 +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
|
0dae5ca236
|
修订代码文档,完善zap
|
2022-03-31 19:03:58 +08:00 |
|
hahahrfool
|
b97e990b44
|
尝试引入zap包作为log包
|
2022-03-31 18:28:57 +08:00 |
|
hahahrfool
|
f310803218
|
修订代码
|
2022-03-31 14:10:05 +08:00 |
|
hahahrfool
|
b31557df14
|
大范围修订代码,以试图防止内存逃逸到堆;
|
2022-03-31 13:33:58 +08:00 |
|
hahahrfool
|
2f53ffe591
|
移除-bl参数。buf尺寸过小的话,反倒会导致更大的内存泄漏问题
|
2022-03-31 09:59:48 +08:00 |
|
hahahrfool
|
8606e6e573
|
添加-mp参数进行memory pprof. 修订代码
|
2022-03-31 08:36:59 +08:00 |
|
hahahrfool
|
d696d96b29
|
恢复readv相关代码;
之前认为readv内存泄漏所以做了特殊处理;现在发现没必要,在没有悬垂链接时,并没有泄漏. 于是改回.
|
2022-03-31 02:01:46 +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
|
3fa75b181f
|
修订代码,注释;修复小bug
|
2022-03-30 19:54:16 +08:00 |
|
hahahrfool
|
6ef8bf57c1
|
添加quic和hy阻控; 若tls证书配置未指明,会在内存生成随机rsa证书
|
2022-03-30 14:33:14 +08:00 |
|
hahahrfool
|
fbadaeb337
|
修订代码
|
2022-03-29 22:12:58 +08:00 |
|
hahahrfool
|
01d681f14f
|
修订代码,注释,示例
|
2022-03-29 21:58:23 +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
|
0e1bfde04d
|
修订代码
|
2022-03-28 22:42:09 +08:00 |
|
hahahrfool
|
81160e8db2
|
广泛修订代码, 注释
|
2022-03-28 22:07:18 +08:00 |
|
hahahrfool
|
1b6dfde7b6
|
修订代码,试图防止udp被lazy处理;修订文档,注释
|
2022-03-28 08:33:50 +08:00 |
|
hahahrfool
|
9523ad3e90
|
修订注释,示例文件
|
2022-03-27 21:45:40 +08:00 |
|
hahahrfool
|
f9872feee7
|
修订代码,文档,注释,示例.
|
2022-03-27 21:06:57 +08:00 |
|
hahahrfool
|
0ed518c21a
|
修复分流失效的bug;该bug从1.0.6开始出现;修订代码,示例
|
2022-03-27 14:52:59 +08:00 |
|
hahahrfool
|
e9c9467a72
|
修订代码,文档,注释
|
2022-03-27 14:09:53 +08:00 |
|