sniffing protocol for port forwarding

This commit is contained in:
ginuerzh committed 2022-11-30 10:54:19 +08:00
1 parent 5f31240e29
commit 2e89811d59
9 files changed
+46 -9

No files matched your search

+10
View File
@@ -103,6 +103,16 @@ func (p *chainHop) Select(ctx context.Context, opts ...chain.SelectOption) *chai
if len(filters) == 0 {
filters = nodes
}
} else if protocol := options.Protocol; protocol != "" {
filters = nil
for _, node := range p.nodes {
if node == nil {
continue
}
if node.Options().Protocol == protocol {
filters = append(filters, node)
}
}
}
var nodes []*chain.Node