尝试整个网络代理 以netstack为代理服务器,想实现网络通信的server调用特殊的api代理,要如何避开内核网络栈呢?

This commit is contained in:
impact-eintr
2022-11-30 18:38:50 +08:00
parent 7b3086540d
commit 3d8ca3c0c8
5 changed files with 273 additions and 100 deletions

View File

@@ -76,6 +76,7 @@ type Options struct {
Stats tcpip.Stats
}
// New 新建一个网络协议栈
func New(network []string, transport []string, opts Options) *Stack {
clock := opts.Clock
if clock == nil {
@@ -115,7 +116,9 @@ func New(network []string, transport []string, opts Options) *Stack {
proto: transProto,
}
}
// TODO 添加传输层分流器
// 添加传输层分流器
s.demux = newTransportDemuxer(s)
return s
}