类 HttpTransportConfig.Builder

java.lang.Object
io.agentscope.core.model.transport.HttpTransportConfig.Builder
封闭类:
HttpTransportConfig

public static class HttpTransportConfig.Builder extends Object
Builder for HttpTransportConfig.
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • connectTimeout

      public HttpTransportConfig.Builder connectTimeout(Duration connectTimeout)
      Set the connect timeout.
      参数:
      connectTimeout - the connect timeout duration
      返回:
      this builder
    • readTimeout

      public HttpTransportConfig.Builder readTimeout(Duration readTimeout)
      Set the read timeout.
      参数:
      readTimeout - the read timeout duration
      返回:
      this builder
    • writeTimeout

      public HttpTransportConfig.Builder writeTimeout(Duration writeTimeout)
      Set the write timeout.
      参数:
      writeTimeout - the write timeout duration
      返回:
      this builder
    • maxIdleConnections

      public HttpTransportConfig.Builder maxIdleConnections(int maxIdleConnections)
      Set the maximum number of idle connections in the pool.
      参数:
      maxIdleConnections - the max idle connections
      返回:
      this builder
    • keepAliveDuration

      public HttpTransportConfig.Builder keepAliveDuration(Duration keepAliveDuration)
      Set the keep-alive duration for idle connections.
      参数:
      keepAliveDuration - the keep-alive duration
      返回:
      this builder
    • ignoreSsl

      public HttpTransportConfig.Builder ignoreSsl(boolean ignoreSsl)
      Set whether to ignore SSL certificate verification.

      Warning: Setting this to true disables SSL certificate verification, which makes the connection vulnerable to man-in-the-middle attacks. This should only be used for testing or with trusted self-signed certificates.

      参数:
      ignoreSsl - true to ignore SSL certificate verification, false otherwise
      返回:
      this builder
    • proxy

      public HttpTransportConfig.Builder proxy(ProxyConfig proxyConfig)
      Set the proxy configuration.

      Supports HTTP and SOCKS proxies. See ProxyConfig for details.

      参数:
      proxyConfig - the proxy configuration
      返回:
      this builder
    • httpVersion

      public HttpTransportConfig.Builder httpVersion(HttpVersion httpVersion)
      Set the HTTP version to use.
      参数:
      httpVersion - the HTTP version
      返回:
      this builder
    • build

      public HttpTransportConfig build()
      Build the HttpTransportConfig.
      返回:
      a new HttpTransportConfig instance