nps/module.md
2019-10-13 13:25:22 +08:00

37 lines
650 B
Markdown
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.

主干程序模块化编写
假设socks5来说
首先需要定一个一个socks5 struct {
包含
客户端地址
服务端地址
读到的用户名
读到的密码
连接类型tcp、udp
远程地址ipv4 ipv6
远程端口
}
每个模块需要一个获取配置参数的func
定义好了之后在每每个模块中对该结=结构体进行操作
调用每一个模块的时候,需要如下参数
ctx上线文
socks5结构体
该module的配置
当前的connection
预分配的connection
每个模块根据自己的业务逻辑进行处理
其他技术:
零拷贝
事件驱动
回调
触发器
插件启动范围
插件优先级