add routing rule for node

This commit is contained in:
ginuerzh
2024-11-15 20:28:47 +08:00
parent 79b6b9138e
commit c2aedbabd9
11 changed files with 1071 additions and 145 deletions
+5 -1
View File
@@ -251,9 +251,13 @@ func (h *Sniffer) dial(ctx context.Context, conn net.Conn, req *http.Request, ho
}
if ho.Hop != nil {
node = ho.Hop.Select(ctx,
hop.HostSelectOption(host),
hop.ClientIPSelectOption(net.ParseIP(ro.ClientIP)),
hop.ProtocolSelectOption(sniffing.ProtoHTTP),
hop.HostSelectOption(host),
hop.MethodSelectOption(req.Method),
hop.PathSelectOption(req.URL.Path),
hop.QuerySelectOption(req.URL.Query()),
hop.HeaderSelectOption(req.Header),
)
}
if node == nil {