Skip to content

fix: support socks5h:// scheme in SOCKS_PROXY_HOST regex - #900

Open
Matobi98 wants to merge 3 commits into
lnp2pBot:mainfrom
Matobi98:fix/socks-proxy-regex-scheme
Open

fix: support socks5h:// scheme in SOCKS_PROXY_HOST regex#900
Matobi98 wants to merge 3 commits into
lnp2pBot:mainfrom
Matobi98:fix/socks-proxy-regex-scheme

Conversation

@Matobi98

@Matobi98 Matobi98 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Fixes SOCKS_PROXY_HOST regex to match the socks5h:// scheme (regression from #826), found while testing #885.

Summary by CodeRabbit

  • Bug Fixes
    • SOCKS proxy URL validation now supports the socks, socks4, socks5, and socks5h schemes.
    • The unsupported socks4h scheme now receives the default socks5:// prefix.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Matobi98, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 23 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a18de3db-6a8f-446d-a29b-5b5da3ab7a61

📥 Commits

Reviewing files that changed from the base of the PR and between b965749 and 7b568b6.

📒 Files selected for processing (3)
  • app.ts
  • tests/util/index.spec.ts
  • util/index.ts

Walkthrough

The SOCKS proxy URL validation now explicitly accepts socks, socks4, socks5, and socks5h. The socks4h scheme is no longer recognized and receives the default socks5:// prefix.

Changes

SOCKS scheme validation

Layer / File(s) Summary
Recognize supported SOCKS schemes
app.ts
The validation pattern explicitly accepts four SOCKS schemes and excludes socks4h.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A rabbit checks the proxy line,
Four SOCKS schemes now align.
socks4h hops away,
socks5h is here to stay.
The prefix rules are clear.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding support for the socks5h:// scheme in the SOCKS_PROXY_HOST regex.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app.ts`:
- Line 53: Update the proxy-scheme validation in the proxyUrl assignment to use
an explicit case-insensitive allowlist accepting only socks://, socks4://,
socks5://, and socks5h://; reject socksh:// and socks4h:// before constructing
proxyUrl.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e884ecc4-5b53-437c-87de-aac0611d9db5

📥 Commits

Reviewing files that changed from the base of the PR and between a29b8a4 and 02eae10.

📒 Files selected for processing (1)
  • app.ts

Comment thread app.ts Outdated
@knocte

knocte commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

If there was a recent regression, it means we lacked a test, so please create a test now so that it doesn't happen again.

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.

2 participants