8000 Issue with ApacheDockerHttpClient Handling unix:// Connections · Issue #2380 · docker-java/docker-java · GitHub
[go: up one dir, main page]

Skip to content
Issue with ApacheDockerHttpClient Handling unix:// Connections #2380
Closed as duplicate of#2363
@latamsystems

Description

@latamsystems

Hi Docker-Java-Devs,

I hope you're doing well.

I wanted to bring to your attention an issue I've encountered with the ApacheDockerHttpClient when connecting to Docker via a Unix socket (unix://). Specifically, when the client detects a unix:// connection, it automatically changes the host to localhost:2375. This behavior causes issues when the Docker host is intended to be a Unix socket, and not TCP.

This seems to be problematic both on Linux and Windows environments, as it tries to connect to the wrong endpoint (localhost), resulting in the following error:

HttpHostConnectException: Connect to unix://localhost:2375 failed: Connection refused

Interestingly, this issue does not occur when using the OkHttpDockerHttpClient. The OkHttp client correctly handles the unix:// scheme without trying to alter the connection to localhost, which resolves the issue.

It would be great if we could review and potentially update the handling of unix:// connections in ApacheDockerHttpClient to prevent this automatic conversion to localhost.

Let me know if you need any further details or assistance on this.

Best regards,
Luis Miguel Vasquez
Java Developer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0