Skip to content

[Bug] 多人访问公开隧道页面时触发固定连接数限制 #542

Description

@su-fen

Affected area

Gateway (agent-gateway / Go)

Version or commit

main@1de9b452

Environment

  • Desktop: macOS
  • Deployment: LiveAgent desktop connected to agent-gateway
  • Feature: public Web Tunnel exposing a local HTTP page

Steps to reproduce

  1. Enable Web Tunnel and expose a local page through the public /t/{slug}/ path.
  2. Let multiple users open the same public page at approximately the same time.
  3. Allow the page to load its HTML, JavaScript, CSS, images, API requests, or WebSocket connections until more than 20 tunnel streams are active.
  4. Observe one or more resource requests fail.

Expected behavior

Multiple users can load the tunneled page without an application-level fixed limit rejecting the 21st concurrent HTTP request or WebSocket connection.

Actual behavior

The gateway counts every HTTP request and WebSocket as an independent tunnel stream. Each tunnel has a hard-coded maximum of 20 active streams, so the 21st stream receives HTTP 429 with the following response body:

tunnel connection limit exceeded

This is request-level concurrency rather than visitor-level concurrency, so a small number of users can exhaust the limit while loading a normal page. Long-lived WebSocket, SSE, and slow requests make it easier to reproduce.

Logs / screenshots

No screenshot. The gateway response is HTTP 429 with body:

tunnel connection limit exceeded

The behavior is covered by the existing tunnel lifecycle and error-mapping tests.

Pre-submit checklist

  • I searched existing issues and pull requests and found no duplicates.
  • This is not a security vulnerability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions