Skip to content

feat(edge): ZGROK-082 - Connection and Resource Limits#65

Merged
copyleftdev merged 1 commit intomainfrom
feat/ZGROK-082-connection-limits
Jan 25, 2026
Merged

feat(edge): ZGROK-082 - Connection and Resource Limits#65
copyleftdev merged 1 commit intomainfrom
feat/ZGROK-082-connection-limits

Conversation

@copyleftdev
Copy link
Copy Markdown
Owner

Summary

  • Add ResourceLimits config for tunnels/account, streams/tunnel, body size, timeouts
  • Implement ConnectionTracker with per-account, per-IP, and global limits
  • ConnectionPermit RAII guard for automatic slot release on drop
  • StreamTracker with per-tunnel stream limits and StreamPermit guard
  • LimitError enum with appropriate HTTP status codes (413, 503, 504)
  • check_body_size helper for request body validation

Test plan

  • All 456 tests pass
  • Clippy clean with -D warnings
  • Format verified with cargo fmt --check

Closes #82

🤖 Generated with Claude Code

Add multi-dimensional connection limiting infrastructure:
- ResourceLimits config with tunnels/account, streams/tunnel, body size limits
- ConnectionTracker with per-account, per-IP, and global connection limits
- ConnectionPermit RAII guard for automatic slot release
- StreamTracker for per-tunnel stream limits with StreamPermit guard
- LimitError with appropriate HTTP status codes (413, 503, 504)
- check_body_size helper for request body validation
- 15 comprehensive tests

Closes #82

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@copyleftdev copyleftdev merged commit 34f4fa7 into main Jan 25, 2026
@copyleftdev copyleftdev deleted the feat/ZGROK-082-connection-limits branch January 25, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant