Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions docker-java-transport-httpclient5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.0.3</version>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents.core5</groupId>
<artifactId>httpcore5-h2</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import javax.net.ssl.SSLContext;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URI;
import java.time.Duration;
Expand Down Expand Up @@ -147,17 +148,31 @@ private Registry<ConnectionSocketFactory> createConnectionSocketFactoryRegistry(
return socketFactoryRegistryBuilder
.register("tcp", PlainConnectionSocketFactory.INSTANCE)
.register("http", PlainConnectionSocketFactory.INSTANCE)
.register("unix", new PlainConnectionSocketFactory() {
.register("unix", new ConnectionSocketFactory() {
@Override
public Socket createSocket(HttpContext context) throws IOException {
return UnixSocket.get(dockerHost.getPath());
}

@Override
public Socket connectSocket(TimeValue timeValue, Socket socket, HttpHost httpHost, InetSocketAddress inetSocketAddress,
InetSocketAddress inetSocketAddress1, HttpContext httpContext) throws IOException {
return PlainConnectionSocketFactory.INSTANCE.connectSocket(timeValue, socket, httpHost, inetSocketAddress,
inetSocketAddress1, httpContext);
}
})
.register("npipe", new PlainConnectionSocketFactory() {
.register("npipe", new ConnectionSocketFactory() {
@Override
public Socket createSocket(HttpContext context) {
return new NamedPipeSocket(dockerHost.getPath());
}

@Override
public Socket connectSocket(TimeValue timeValue, Socket socket, HttpHost httpHost, InetSocketAddress inetSocketAddress,
InetSocketAddress inetSocketAddress1, HttpContext httpContext) throws IOException {
return PlainConnectionSocketFactory.INSTANCE.connectSocket(timeValue, socket, httpHost, inetSocketAddress,
inetSocketAddress1, httpContext);
}
})
.build();
}
Expand Down