Class: WebSocket experimental
networkBeta
用于管理 WebSocket 连接。
Used to manage WebSocket connections.
Methods
connect()
connect(
uri,headers?):Promise<WebSocketClient>
World Mutation Beta
Parameters
uri
string
要建立连接的 URL。
URL to make connection to.
headers?
Returns
Promise<WebSocketClient>
一个可等待的 Promise,其结果为已连接的 WebSocket 客户端。
An awaitable promise that contains the WebSocket client that was connected.
Remarks
尝试连接一个 WebSocket 客户端。
Attempts to connect a WebSocket client.
