类 WebSocketTransportConfig
java.lang.Object
io.agentscope.core.model.transport.websocket.WebSocketTransportConfig
Configuration for WebSocket clients.
This class holds configuration options for WebSocket client behavior such as timeouts, heartbeat intervals, proxy settings, and SSL options.
Usage example:
WebSocketTransportConfig config = WebSocketTransportConfig.builder()
.connectTimeout(Duration.ofSeconds(30))
.pingInterval(Duration.ofSeconds(30))
.proxy(ProxyConfig.http("proxy.example.com", 8080))
.build();
WebSocketTransport client = OkHttpWebSocketTransport.create(config);
-
嵌套类概要
嵌套类 -
字段概要
字段 -
方法概要
修饰符和类型方法说明builder()Create a new builder for WebSocketTransportConfig.static WebSocketTransportConfigdefaults()Create a default configuration.Get the connect timeout.Get the ping interval for heartbeat (OkHttp only).Get the proxy configuration.Get the read timeout.Get the write timeout.booleanGet whether SSL certificate verification should be ignored.
-
字段详细资料
-
DEFAULT_CONNECT_TIMEOUT
Default connect timeout: 30 seconds. -
DEFAULT_READ_TIMEOUT
Default read timeout: 0 (no timeout for WebSocket). -
DEFAULT_WRITE_TIMEOUT
Default write timeout: 30 seconds. -
DEFAULT_PING_INTERVAL
Default ping interval: 30 seconds.
-
-
方法详细资料
-
getConnectTimeout
Get the connect timeout.- 返回:
- the connect timeout duration
-
getReadTimeout
Get the read timeout.- 返回:
- the read timeout duration
-
getWriteTimeout
Get the write timeout.- 返回:
- the write timeout duration
-
getPingInterval
Get the ping interval for heartbeat (OkHttp only).- 返回:
- the ping interval duration
-
getProxyConfig
Get the proxy configuration.- 返回:
- the proxy configuration, or null if no proxy is configured
-
isIgnoreSsl
public boolean isIgnoreSsl()Get whether SSL certificate verification should be ignored.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.
- 返回:
- true to ignore SSL certificate verification, false otherwise
-
builder
Create a new builder for WebSocketTransportConfig.- 返回:
- a new Builder instance
-
defaults
Create a default configuration.- 返回:
- a default WebSocketTransportConfig instance
-