Skip to content

feat: support batch TCP/UDP port ranges in stream_proxy config#13153

Merged
Baoyuantop merged 4 commits intoapache:masterfrom
shreemaan-abhishek:backport-pr3-port-ranges
Apr 8, 2026
Merged

feat: support batch TCP/UDP port ranges in stream_proxy config#13153
Baoyuantop merged 4 commits intoapache:masterfrom
shreemaan-abhishek:backport-pr3-port-ranges

Conversation

@shreemaan-abhishek
Copy link
Copy Markdown
Contributor

@shreemaan-abhishek shreemaan-abhishek commented Apr 3, 2026

Summary

  • Allows specifying port ranges (e.g., "9100-9200") in stream_proxy TCP/UDP configuration
  • Leverages nginx native port range support for batch listeners
  • Adds validate_port_or_range() validation with comprehensive error checking
  • Supports all forms: plain ranges, address:range, and table form with TLS

Test plan

  • TCP port range generates correct listen directive in nginx.conf
  • UDP port range with udp flag
  • Address with port range (e.g., 127.0.0.1:2000-2005)
  • Object form with TLS enabled
  • Mixed entries (ranges + individual ports + addresses)
  • Backward compatibility with existing config formats
  • Negative cases: port 0, port 65536, reversed range, float ports, missing port, etc.

Backport Agent added 2 commits April 3, 2026 12:28
Backport from EE commit 1d229d95b. Add validate_port_or_range function
to ops.lua for validating port entries including range syntax (e.g.,
"9100-9200"). Update stream_proxy TCP/UDP normalization to validate all
entries and reject invalid ports, ranges, and formats.
The stream_proxy config requires proxy_mode: "http&stream" to enable
stream processing in APISIX.
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 3, 2026
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Apr 3, 2026
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
@Baoyuantop Baoyuantop merged commit 05a30ab into apache:master Apr 8, 2026
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants