mirror of
https://github.com/impact-eintr/netstack.git
synced 2025-10-06 05:16:50 +08:00
尝试整个网络代理 以netstack为代理服务器,想实现网络通信的server调用特殊的api代理,要如何避开内核网络栈呢?
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user