websocket.send

Sends a message to the server using this websocket

ExampleSend a message to a server
Opens a websocket to a server and sends a message.
Code
<nowiki>
local ws, err = http.websocket("wss://echo.websocket.org")
if ws then
  ws.send("Hello")
  ws.close()
end
    </nowiki>

websocket.send
Function
Syntax
websocket.send(
  • message : string
  • binary? : boolean
)

API http
Source CC:Tweaked (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.