sniffing protocol for port forwarding

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

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