-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Improve Unix socket connection handling for proxy compatibility #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Improve Unix socket connection handling for proxy compatibility #53
Conversation
771ee02 to
09cd6c3
Compare
- Use SocketsHttpHandler with ConnectCallback for .NET 8+ (more robust) - Add KeepAlive socket option for better proxy socket compatibility - Add configurable UnixSocketConnectTimeout (default 30s) - Improve error handling with proper socket disposal - Add unit tests for DockerClientConfiguration This change addresses issues with Docker socket proxy wrappers (like those used in some CI environments) that may not work with the legacy ManagedHandler. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
09cd6c3 to
f329d87
Compare
…n container log tests
There was a problem hiding this 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 improves Unix socket connection handling to better support Docker socket proxy wrappers commonly used in CI environments like custom GitHub runners with Docker-in-Docker (DinD). The implementation adds configurable connection timeouts and switches to modern SocketsHttpHandler for .NET 8+.
Key Changes:
- Introduced
SocketConnectTimeoutconfiguration property with a 30-second default timeout - Migrated .NET 8+ Unix socket connections from
ManagedHandlertoSocketsHttpHandlerwithConnectCallback - Added
KeepAlivesocket option for improved proxy compatibility across all platforms
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
DockerClientConfiguration.cs |
Adds SocketConnectTimeout parameter/property with default value of 30 seconds |
DockerClient.cs |
Implements modern SocketsHttpHandler for .NET 8+ and timeout handling with KeepAlive for all platforms |
DockerClientConfigurationTests.cs |
New unit tests validating default and custom timeout configuration values |
IContainerOperationsTests.cs |
Changes ThrowsAsync to ThrowsAnyAsync for more accurate cancellation exception assertions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…entials and adding cancellation support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Improves Unix socket connection handling to work better with Docker socket proxy wrappers (like those used in some CI environments such as custom GitHub runners with DinD).
Changes
SocketsHttpHandlerwithConnectCallbackinstead of the legacyManagedHandlerKeepAlivesocket option for better proxy compatibilitySocketConnectTimeoutproperty (default 30 seconds)Files Changed
DockerClientConfiguration.csSocketConnectTimeoutparameter/propertyDockerClient.csSocketsHttpHandlerfor .NET 8+, improvedManagedHandlerfor .NET StandardDockerClientConfigurationTests.csTest plan
🤖 Generated with Claude Code