Skip to content

fix: add --socks5 and --connect flags to send subcommand#1053

Merged
schollz merged 1 commit intoschollz:mainfrom
murataslan1:fix/socks5-flag-support
Feb 5, 2026
Merged

fix: add --socks5 and --connect flags to send subcommand#1053
schollz merged 1 commit intoschollz:mainfrom
murataslan1:fix/socks5-flag-support

Conversation

@murataslan1
Copy link
Copy Markdown
Contributor

Description

This PR fixes issue #1051 where users expected to use --socks5 and --connect flags directly on the send subcommand, but these flags were only available as global flags.

Changes

Added --socks5 and --connect flags to the send subcommand's flag list, allowing both syntaxes to work:

  • croc --socks5 "127.0.0.1:9050" send file.txt (existing global flag - still works)
  • croc send --socks5 "127.0.0.1:9050" file.txt (new, more intuitive syntax)

Why

Users naturally expect flags to work when placed after the subcommand. The current implementation only supported the global flag syntax, which required flags before send. While the README showed the correct syntax, this wasn't intuitive for users who are accustomed to specifying command-specific flags after the subcommand.

The environment variables SOCKS5_PROXY and HTTP_PROXY continue to work as fallbacks.

Testing

The fix maintains backward compatibility:

  • Global flags continue to work as before
  • Environment variables continue to work as before
  • New subcommand-level flags now also work

Related Issue

Fixes #1051

Allow users to specify SOCKS5 and HTTP proxy settings directly
on the send subcommand, enabling both syntaxes:
- croc --socks5 "..." send file.txt (existing global flag)
- croc send --socks5 "..." file.txt (new, more intuitive)

This fixes the issue where users expected the more natural syntax
of specifying flags after the subcommand, which previously only
worked via the SOCKS5_PROXY environment variable.

Fixes schollz#1051
Copilot AI review requested due to automatic review settings February 5, 2026 10:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #1051 by adding --socks5 and --connect flags to the send subcommand's flag list. Previously, these flags were only available as global flags (before the send command), which was unintuitive for users who naturally expect to place flags after the subcommand.

Changes:

  • Added --socks5 and --connect flags to the send subcommand with identical definitions to the global flags
  • Both flag placements now work: croc --socks5 X send file (existing) and croc send --socks5 X file (new)
  • Environment variable support (SOCKS5_PROXY and HTTP_PROXY) is maintained in both flag definitions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@schollz schollz merged commit 1b2de19 into schollz:main Feb 5, 2026
6 of 7 checks passed
@schollz
Copy link
Copy Markdown
Owner

schollz commented Feb 5, 2026

Thanks

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.

[Bug]: croc socks option on linux is not using value

3 participants