|
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,31 @@ 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, |
| 159 | + InetSocketAddress inetSocketAddress1, HttpContext httpContext) throws IOException { |
| 160 | + return PlainConnectionSocketFactory.INSTANCE.connectSocket(timeValue, socket, httpHost, inetSocketAddress, |
| 161 | + inetSocketAddress1, httpContext); |
| 162 | + } |
155 | 163 | }) |
156 | | - .register("npipe", new PlainConnectionSocketFactory() { |
| 164 | + .register("npipe", new ConnectionSocketFactory() { |
157 | 165 | @Override |
158 | 166 | public Socket createSocket(HttpContext context) { |
159 | 167 | return new NamedPipeSocket(dockerHost.getPath()); |
160 | 168 | } |
| 169 | + |
| 170 | + @Override |
| 171 | + public Socket connectSocket(TimeValue timeValue, Socket socket, HttpHost httpHost, InetSocketAddress inetSocketAddress, |
| 172 | + InetSocketAddress inetSocketAddress1, HttpContext httpContext) throws IOException { |
| 173 | + return PlainConnectionSocketFactory.INSTANCE.connectSocket(timeValue, socket, httpHost, inetSocketAddress, |
| 174 | + inetSocketAddress1, httpContext); |
| 175 | + } |
161 | 176 | }) |
162 | 177 | .build(); |
163 | 178 | } |
|
0 commit comments