From b423efcc33bddd0e30b0a7d30ed9974bef98b0af Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Sat, 21 Nov 2026 17:10:40 +0300 Subject: [PATCH] acl: a rule names several services by repeating the entry A comma ends an entry of a port list, so a rule names several services by repeating it, one with each: *@1080,*@1090 names the two, and @1080-1090 names a range of ports. A bare @1080,1090 leaves 1090 a destination port, which the man page warns of. --- man/3proxy.cfg.5 | 4 +++- tests/cases/viaport.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/man/3proxy.cfg.5 b/man/3proxy.cfg.5 index 4296e5e..2cb85db 100644 --- a/man/3proxy.cfg.5 +++ b/man/3proxy.cfg.5 @@ -928,7 +928,9 @@ one service's connections alone, e.g. connlim 5 60 * * * @1080 .br denies the sixth concurrent connection of the service on port 1080, -whatever it connects to. For any field * +whatever it connects to. A comma ends an entry, so several services are +listed by repeating it: *@1080,*@1090 names the two, and a bare +@1080,1090 would leave 1090 a destination port. For any field * sign means ANY. If access list is empty it\'s assumed to be .br allow * diff --git a/tests/cases/viaport.py b/tests/cases/viaport.py index 4c6305b..0a1e037 100644 --- a/tests/cases/viaport.py +++ b/tests/cases/viaport.py @@ -97,3 +97,19 @@ def run(t): "log\nallow * * * 443@\nnot_a_command\n") t.contains(out, "Invalid port or port range", "a service with nothing after the @ is refused") + + # several services in one rule: the entry repeated with each + sev1, sev2 = t.free_port(), t.free_port() + t.start("viaport_both", f""" + log + auth iponly + deny * * * @{sev1},@{sev2} + allow * + proxy -p{sev1} + proxy -p{sev2} + """, ports=[sev1, sev2]) + + t.ne(200, t.http(url, proxy=f"127.0.0.1:{sev1}").status, + "the first service a repeated entry names is refused") + t.ne(200, t.http(url, proxy=f"127.0.0.1:{sev2}").status, + "and so is the second")