Web Sockets
WebSocket.connect
<WebSocketConnection> WebSocket.connect(<string> url)Establishes a WebSocket connection to the specified URL.
local ws = WebSocket.connect("ws://localhost:8080")
ws.OnMessage:Connect(function(message)
print(message)
end)
ws.OnClose:Connect(function()
print("Closed")
end)
ws:Send("Hello, World!")WebSocketConnection
ws = WebSocket.connect(url)Methods
Method
Description
Sends a message over the WebSocket connection
Closes the WebSocket connection
Events
Event
Description
Fired when a message is received over the WebSocket connection
Fired when the WebSocket connection is closed
Last updated