websocket.send

From ComputerCraft
Jump to: navigation, search


websocket.send
Function
Syntax
websocket.send()
API http
Source CC:Tweaked (source)

Sends a message to the server using this websocket

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