Skip to content

Conversation

@ameshkov
Copy link
Owner

Closes #43

@ameshkov ameshkov requested a review from Copilot October 13, 2025 08:20
@ameshkov ameshkov self-assigned this Oct 13, 2025
Copy link

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 adds support for the --connect-timeout command-line argument to gocurl, addressing issue #43. The feature allows users to specify a maximum time in seconds for the connection phase, which applies to both direct connections and proxy connections (including SOCKS5).

  • Added ConnectTimeout field to configuration structures and command-line options
  • Implemented timeout support across all connection types (direct, HTTP/HTTPS proxy, SOCKS5 proxy)
  • Updated test suite to verify timeout functionality and refactored for better testability

Reviewed Changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/config/options.go Added ConnectTimeout field and updated parseOptions to accept args parameter
internal/config/config.go Added ConnectTimeout field to Config struct and updated ParseConfig signature
internal/cmd/cmd.go Refactored Main function to extract testable Run function with proper error handling
internal/output/output.go Enhanced Output struct with Writer interface, added Error method and JSON output support
internal/client/clientdialer.go Added timeout conversion and propagation to dialers
internal/client/dialer/direct.go Implemented connection timeout for direct connections
internal/client/proxy/*.go Added timeout support for SOCKS5 and HTTP proxy connections
internal/cmd/cmd_test.go Added comprehensive test suite for command functionality
Multiple test files Updated NewOutput calls to include new jsonOutput parameter
go.mod Updated Go version and dependencies
README.md Added documentation for --connect-timeout flag

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ameshkov ameshkov merged commit 05e4b93 into master Oct 13, 2025
12 checks passed
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.

Add --connect-timeout argument

2 participants