Skip to main content

参数

WebSocket
必填
WebSocket.connect 返回的 WebSocket table。Send 通过 WebSocket object methods 解析,因此文档中的调用形式是 socket:Send(..).
string
必填
传给 curl_ws_send 的 Lua string payload,并带有 explicit byte length。
boolean
当此 argument 存在且为 true 时,Send 使用 CURLWS_BINARY。否则使用 CURLWS_TEXT。

示例

Send text or binary data through a WebSocket object returned by WebSocket.connect.