You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -60,4 +60,4 @@ function resty_websocket_client:close() end
60
60
---@fieldheadersstring[] custom headers to be sent in the handshake request. The table is expected to contain strings in the format {"a-header: a header value", "another-header: another header value"}.
---Note that this method does not wait for a close frame from the remote end.
73
+
---@paramcode?integer
74
+
---@parammsg?string
75
+
---@returninteger?bytes
76
+
---@returnstring?error
77
+
functionwebsocket:send_close(code, msg) end
78
+
79
+
---Sends out a raw websocket frame by specifying the fin field (boolean value), the opcode, and the payload.
80
+
---
81
+
---For a list of valid opcode, see
82
+
---
83
+
---http://tools.ietf.org/html/rfc6455#section-5.2
84
+
---
85
+
---In case of errors, returns nil and a string describing the error.
86
+
---
87
+
---To control the maximal payload length allowed, you can pass the max_payload_len option to the new constructor.
88
+
---
89
+
---To control whether to send masked frames, you can pass true to the send_masked option in the new constructor method. By default, unmasked frames are sent.
90
+
---@paramfinboolean
91
+
---@paramopcoderesty.websocket.protocol.opcode
92
+
---@parampayloadstring
93
+
---@returninteger?bytes
94
+
---@returnstring?error
95
+
functionwebsocket:send_frame(fin, opcode, payload) end
96
+
97
+
---Receives a WebSocket frame from the wire.
98
+
---
99
+
---In case of an error, returns two nil values and a string describing the error.
100
+
---
101
+
---The second return value is always the frame type, which could be one of continuation, text, binary, close, ping, pong, or nil (for unknown types).
102
+
---
103
+
---For close frames, returns 3 values: the extra status message (which could be an empty string), the string "close", and a Lua number for the status code (if any). For possible closing status codes, see
0 commit comments