Module bus.http

Class ConnectInterceptor

java.lang.Object
org.miaixz.bus.http.accord.ConnectInterceptor
All Implemented Interfaces:
Interceptor

public final class ConnectInterceptor extends Object implements Interceptor
An interceptor that opens a connection to the target server and proceeds to the next interceptor.
Since:
Java 17+
Author:
Kimi Liu
  • Field Details

    • httpd

      public final Httpd httpd
      The httpd client instance.
  • Constructor Details

    • ConnectInterceptor

      public ConnectInterceptor(Httpd httpd)
      Constructs a new ConnectInterceptor.
      Parameters:
      httpd - The Httpd client instance.
  • Method Details

    • intercept

      public Response intercept(NewChain chain) throws IOException
      Intercepts the request to establish a connection and create an exchange.
      Specified by:
      intercept in interface Interceptor
      Parameters:
      chain - The interceptor chain.
      Returns:
      The response from the server.
      Throws:
      IOException - if an I/O error occurs during the connection.