[Fix] Use elevated ports for tunnel origin - #229
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughChangesTunnel origin port resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized fix changes tunnel origin port selection for active redirects, with normal checks reported as passing; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant TunnelStartup
participant origin_ports
participant ActivePortRedirector
participant OriginTarget
TunnelStartup->>origin_ports: Resolve listener origin ports
origin_ports->>ActivePortRedirector: Check active privileged-port redirect
ActivePortRedirector-->>origin_ports: Return redirect status
origin_ports-->>TunnelStartup: Return plain and TLS ports
TunnelStartup->>OriginTarget: Build target with resolved ports
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Description checkExplanation The description clearly explains the failure, the fix, affected tunnel types, motivation, and macOS validation. It does not use all template headings or checklist boxes, but the required change information is mostly present. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
I noticed my cloudflared tunnel stopped working (502 on the public hostname). The generated config pointed cloudflared at 127.0.0.1:8443, but since I ran
yerd elevate portsthe pf redirect makes direct connections to 8443 hang, so cloudflared could never reach the origin. Pointing it at 443 by hand fixed it.This makes the tunnel check whether the port redirect is active when it starts and use 80/443 in that case, otherwise it keeps using the fallback ports like before. Applies to quick and named tunnels. Might be the cause of #225 as well.
Tested on macOS,
cargo fmt, clippy andcargo test -p yerddpass.