add weight for selector

This commit is contained in:
ginuerzh
2022-09-02 17:23:59 +08:00
parent c643014e12
commit 00f7fa2997
16 changed files with 109 additions and 45 deletions

View File

@ -17,7 +17,7 @@ func (h *relayHandler) handleForward(ctx context.Context, conn net.Conn, network
Version: relay.Version1,
Status: relay.StatusOK,
}
target := h.group.Next()
target := h.group.Next(ctx)
if target == nil {
resp.Status = relay.StatusServiceUnavailable
resp.WriteTo(conn)