add scope param for traffic limiter

This commit is contained in:
ginuerzh
2024-08-31 09:30:04 +08:00
parent 9405d1fb48
commit 31c482c649
57 changed files with 1239 additions and 485 deletions
+9 -1
View File
@@ -65,7 +65,15 @@ func (h *tunnelHandler) handleBind(ctx context.Context, conn net.Conn, network,
if h.stats != nil {
stats = h.stats.Stats(tunnelID.String())
}
h.pool.Add(tunnelID, NewConnector(connectorID, tunnelID, h.id, session, h.md.sd, stats), h.md.tunnelTTL)
c := NewConnector(connectorID, tunnelID, h.id, session, &ConnectorOptions{
service: h.options.Service,
sd: h.md.sd,
stats: stats,
limiter: h.limiter,
})
h.pool.Add(tunnelID, c, h.md.tunnelTTL)
if h.md.ingress != nil {
h.md.ingress.SetRule(ctx, &ingress.Rule{
Hostname: endpoint,