Skip to content

Update listening port modes#2382

Open
yadij wants to merge 3 commits intosquid-cache:masterfrom
yadij:arc-ports-5
Open

Update listening port modes#2382
yadij wants to merge 3 commits intosquid-cache:masterfrom
yadij:arc-ports-5

Conversation

@yadij
Copy link
Contributor

@yadij yadij commented Mar 2, 2026

Rename mode 'accel' to 'gateway' and fix documentation to match
RFC 9110 definitions.

Add explicit 'proxy' mode flag and accessor test for forward
proxy mode matching RFC 9110 and to simplify detection of
conflicting port modes.

Split option parsing to enforce [mode] parameter as first and
treat mode names as invalid options when used late. This
simplifies the validation that mode is only specified once and
incompatible modes cannot be configured together on one port.

Rename 'accel' to 'gateway' and fix documentation to match.

Update documentation and code references to accel mode to
gateway mode.

Add explicit mode flag and accessor test for forward-proxy mode.

Split option parsing to enforce [mode] parameter as first and
treat mode names as invalid options when used late. This
simplifies the validation that mode is only specified once and
incompatible modes cannot be configured together on one port.
@yadij yadij added the feature maintainer needs documentation updates for merge label Mar 2, 2026
Copy link
Contributor

@rousskov rousskov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support adding an explicit way to configure a forward proxy mode for ports. I have not reviewed the whole PR but flagged a few problems to facilitate progress. I plan to come back to this PR after the backlog is dealt with.

bool isIntercepted() const { return natIntercept||tproxyIntercept ;}

/// \returns true if the traffic is in any way intercepted
bool isForwardProxy() const { return forwardProxy || (!gatewaySurrogate && !isIntercepted()); }
Copy link
Contributor

@rousskov rousskov Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason to imply that there is some other (unnamed) mode that has the same "forward proxy" meaning as forwardProxy mode. If we add a forwardProxy data member, it should be mutually exclusive with the other port modes (even if this new mode does not have to be explicitly set in squid.conf).

Suggested change
bool isForwardProxy() const { return forwardProxy || (!gatewaySurrogate && !isIntercepted()); }
bool isForwardProxy() const { return forwardProxy; }

Edit: GitHub duplicated an earlier version of this change request while I was writing my review. I have deleted that earlier variation after spotting it in the posted review version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method needs to return true when neither accel/gateway nor intercept/tproxy mode has been set. For backward compatibility with existing configurations before "proxy" mode existed as a setting.

@yadij yadij requested a review from rousskov March 3, 2026 12:25
@yadij yadij added the S-waiting-for-reviewer ready for review: Set this when requesting a (re)review using GitHub PR Reviewers box label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature maintainer needs documentation updates for merge S-waiting-for-reviewer ready for review: Set this when requesting a (re)review using GitHub PR Reviewers box

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants