feat: APISIX Stream Route Enable Disable Plugin
Description
A stream-level plugin that acts as a runtime on/off switch for stream routes.
Operators often need to temporarily disable a stream route during maintenance windows, incident response, or gradual rollouts — without deleting the route from the configuration. This plugin provides that capability by gating TCP/TLS connections at the preread phase: when enabled is true, traffic passes through normally; when false, inbound connections are rejected with a configurable message before the socket is closed.
I opened this issue, and currently raised a MR #13130 regarding the same. Waiting for review, consideration and approval.
Hi @amandewatnitrr, regarding this issue, could we implement a similar status field for stream routes, similar to the HTTP route's status field? This approach would align with existing HTTP route behavior, reduce the cognitive load on users, and skip the route matching phase, eliminating the need to establish a connection before rejecting the route.
Hi @Baoyuantop,
Sure, actually we can do that. I was working on something personal, and had to develop this plugin to solve this issue, to see clear logs. But, yes this is definitely a better solution.
Could you adjust the technical aspects of your PR?