Copilot commented on code in PR #13052:
URL: https://github.com/apache/apisix/pull/13052#discussion_r2922580863


##########
docs/en/latest/plugins/limit-conn.md:
##########
@@ -425,3 +425,22 @@ Response: 429
 ```
 
 This shows the two routes configured in different APISIX instances share the 
same quota.
+
+## Use limit-conn in Stream Proxy
+
+The `limit-conn` plugin can also be used in stream proxy mode.
+
+Example configuration for stream proxy:
+
+```json
+{
+  "plugins": {
+    "limit-conn": {
+      "conn": 1,
+      "burst": 0,
+      "default_conn_delay": 0.1,
+      "key": "remote_addr"
+    }
+  }
+}
+When used in stream proxy mode, only remote_addr and server_addr can be used 
as the key.

Review Comment:
   The JSON example code block isn’t closed, so the following sentence is 
rendered as part of the JSON snippet. Add a closing ``` after the JSON and keep 
the explanatory sentence outside the code block.



##########
docs/en/latest/plugins/limit-conn.md:
##########
@@ -425,3 +425,22 @@ Response: 429
 ```
 
 This shows the two routes configured in different APISIX instances share the 
same quota.
+
+## Use limit-conn in Stream Proxy
+
+The `limit-conn` plugin can also be used in stream proxy mode.
+
+Example configuration for stream proxy:
+
+```json
+{
+  "plugins": {
+    "limit-conn": {
+      "conn": 1,
+      "burst": 0,
+      "default_conn_delay": 0.1,
+      "key": "remote_addr"
+    }
+  }
+}

Review Comment:
   This “stream proxy” example isn’t directly actionable as-written because it 
only shows a partial object. Stream plugin configuration is typically 
demonstrated as a full `stream_route` Admin API payload (including an 
`upstream`) so users can copy/paste it to `/apisix/admin/stream_routes/...`. 
Consider expanding the example accordingly (similar to other stream plugin 
docs).



##########
docs/en/latest/plugins/limit-conn.md:
##########
@@ -425,3 +425,22 @@ Response: 429
 ```
 
 This shows the two routes configured in different APISIX instances share the 
same quota.
+
+## Use limit-conn in Stream Proxy
+
+The `limit-conn` plugin can also be used in stream proxy mode.
+
+Example configuration for stream proxy:
+
+```json
+{
+  "plugins": {
+    "limit-conn": {
+      "conn": 1,
+      "burst": 0,
+      "default_conn_delay": 0.1,
+      "key": "remote_addr"
+    }
+  }
+}
+When used in stream proxy mode, only remote_addr and server_addr can be used 
as the key.

Review Comment:
   The note “only remote_addr and server_addr can be used as the key” doesn’t 
match the stream plugin behavior: `limit-conn` in stream mode reads `key` from 
`ctx.var[key]` (or resolves `var_combination`), so any available Nginx stream 
variable can be used (e.g. `server_port` as well). Please correct or relax this 
statement to avoid documenting an incorrect restriction.
   ```suggestion
   When used in stream proxy mode, the `key` is taken from Nginx stream 
variables (for example, `remote_addr`, `server_addr`, or `server_port`), so any 
available stream variable can be used.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to