Files
v2ray_simple/doc.go
e1732a364fed ece4996342 修订文档,将v2ray_simple中的proxy和adv子包引用转到cmd/verysimple中
v2ray_simple 包作为公共包,不应强制用户使用任何一种proxy
2022-12-19 11:47:42 +08:00

41 lines
1.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
Package v2ray_simple provides a simple way to set up a proxy.
# Structure 本项目结构
utils -> netLayer-> tlsLayer -> httpLayer -> advLayer -> proxy -> v2ray_simple -> machine -> cmd/verysimple
根项目 v2ray_simple 仅研究实际转发过程. 关于 代理的详细定义 请参考 proxy 子包的文档。
本项目是一个代理项目,最重要的事情就是 【如何转发流量】,所以主项目主要研究这个转发过程。
目前主要内容有:
ListenSer函数用于主要 代理的转发。内置了 lazy的转发逻辑。
使用方式可以阅读 tcp_test.go 和 udp_test.go
# Chain
具体 转发过程 的 调用链 是 ListenSer -> handleNewIncomeConnection ->
handshakeInserver_and_passToOutClient -> { handshakeInserver , passToOutClient ->
[ ( checkfallback) -> dialClient_andRelay -> 「 dialClient ( -> dialInnerProxy ),
netLayer.Relay / netLayer.RelayUDP 」 ] }
用 netLayer操纵路由用tlsLayer嗅探tls用httpLayer操纵回落可选经过http头、高级层、innerMux, 都搞好后,进行 proxy 握手,然后就开始转发。
# TLS Lazy Encryption - Lazy
TLS Lazy Encryption 技术 可简称为 tls lazy encrypt, tls lazy 或者 lazy.
lazy 是一种 独特的 转发方式,所以也是在 本包中处理而不是在proxy包中处理。
proxy包只负责定义不负责实际转发。
lazy 与 xtls类似在一定条件下可以利用内层tls加密直接传输数据不在外面再包一层tls。
lazy与xtls的不同是lazy不魔改tls包所以是可以在 uTLS 的基础上 进行 lazy的而且也没有 xtls的233漏洞。
目前lazy还在完善阶段。
*/
package v2ray_simple