|
38 | 38 | import javax.net.ssl.SSLContext; |
39 | 39 | import java.io.IOException; |
40 | 40 | import java.io.InputStream; |
| 41 | +import java.net.InetSocketAddress; |
41 | 42 | import java.net.Socket; |
42 | 43 | import java.net.URI; |
43 | 44 | import java.time.Duration; |
@@ -147,17 +148,27 @@ private Registry<ConnectionSocketFactory> createConnectionSocketFactoryRegistry( |
147 | 148 | return socketFactoryRegistryBuilder |
148 | 149 | .register("tcp", PlainConnectionSocketFactory.INSTANCE) |
149 | 150 | .register("http", PlainConnectionSocketFactory.INSTANCE) |
150 | | - .register("unix", new PlainConnectionSocketFactory() { |
| 151 | + .register("unix", new ConnectionSocketFactory() { |
151 | 152 | @Override |
152 | 153 | public Socket createSocket(HttpContext context) throws IOException { |
153 | 154 | return UnixSocket.get(dockerHost.getPath()); |
154 | 155 | } |
| 156 | + |
| 157 | + @Override |
| 158 | + public Socket connectSocket(TimeValue timeValue, Socket socket, HttpHost httpHost, InetSocketAddress inetSocketAddress, InetSocketAddress inetSocketAddress1, HttpContext httpContext) throws IOException { |
| 159 | + return PlainConnectionSocketFactory.INSTANCE.connectSocket(timeValue, socket, httpHost, inetSocketAddress, inetSocketAddress1, httpContext); |
| 160 | + } |
155 | 161 | }) |
156 | | - .register("npipe", new PlainConnectionSocketFactory() { |
| 162 | + .register("npipe", new ConnectionSocketFactory() { |
157 | 163 | @Override |
158 | 164 | public Socket createSocket(HttpContext context) { |
159 | 165 | return new NamedPipeSocket(dockerHost.getPath()); |
160 | 166 | } |
| 167 | + |
| 168 | + @Override |
| 169 | + public Socket connectSocket(TimeValue timeValue, Socket socket, HttpHost httpHost, InetSocketAddress inetSocketAddress, InetSocketAddress inetSocketAddress1, HttpContext httpContext) throws IOException { |
| 170 | + return PlainConnectionSocketFactory.INSTANCE.connectSocket(timeValue, socket, httpHost, inetSocketAddress, inetSocketAddress1, httpContext); |
| 171 | + } |
161 | 172 | }) |
162 | 173 | .build(); |
163 | 174 | } |
|
0 commit comments