3 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

WebStreamClient

Inherits from: Object

Maintains a streaming connection. To process stream events as they arrive, connect callback functions to each event using RBXScriptSignal:Connect().

Inherits from: Object

Memory category: Instances

Tags: NotCreatable, NotReplicated

Properties

NameType / ReturnsDescription
WebStreamClient.ConnectionStateWebStreamClientStateThe current WebStreamClientState of the client.

Inherited from Object

NameType / ReturnsDescription
Object.ClassNamestringA read-only string representing the class this Object belongs to.
Object.classNamestring

WebStreamClient.ConnectionState

The current WebStreamClientState of the client.

FieldValue
typeWebStreamClientState
tags["ReadOnly","NotReplicated"]
security{"read":"None","write":"None"}
thread safetyReadSafe
categoryData
serialization{"can_load":false,"can_save":true}
capabilities["Network"]

Methods

NameType / ReturnsDescription
WebStreamClient:Close()Closes the client, aborting the ongoing request.
WebStreamClient:Send()Enqueues data to be transmitted to the server over the streaming connection.

Inherited from Object

NameType / ReturnsDescription
Object:GetPropertyChangedSignalRBXScriptSignalGet an event that fires when a given property of the object changes.
Object:IsAbooleanReturns true if an object's class matches or inherits from a given class.
Object:isAboolean

WebStreamClient:Close

Closes the client, aborting the ongoing request. If successful, fires the WebStreamClient.Closed event.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Network"]

WebStreamClient:Send

Enqueues data to be transmitted to the server over the connection. Only works on clients created with WebStreamClientType.WebSocket. For other client types it does nothing.

Parameters

NameTypeDefaultDescription
datastringText string to send to the server.

Returns

TypeDescription
()
FieldValue
securityNone
thread safetyUnsafe
capabilities["Network"]

Events

NameType / ReturnsDescription
WebStreamClient.ClosedFires when the streaming connection is closed, either by the server or by a call to WebStreamClient:Close().
WebStreamClient.ErrorFires if an error is received while establishing the connection or during the connection lifetime.
WebStreamClient.MessageReceivedFires each time a message is received from the server.
WebStreamClient.OpenedFires when the a connection is successfully established between the client and server, allowing for events to begin streaming.

Inherited from Object

NameType / ReturnsDescription
Object.ChangedFires immediately after a property of the object changes, with some limitations.

WebStreamClient.Closed

Fires when the server closes the connection succesfully or the user calls WebStreamClient:Close()

FieldValue
securityNone
capabilities["Network"]

WebStreamClient.Error

Fires if an error is received while establishing the connection or during the connection lifetime.

Parameters

NameTypeDefaultDescription
responseStatusCodeintThe standard HTTP error status code (e.g., 404, 500).
errorMessagestringA descriptive message containing details about the error.
FieldValue
securityNone
capabilities["Network"]

WebStreamClient.MessageReceived

Fires each time a message is received from the server. The format differs based on the WebStreamClientType.

Parameters

NameTypeDefaultDescription
messagestringThe message data payload received from the server stream.
FieldValue
securityNone
capabilities["Network"]

WebStreamClient.Opened

Fires when the a connection is successfully established between the client and server, allowing for events to begin streaming. Provides any response headers in raw format, which can be used for validation.

Parameters

NameTypeDefaultDescription
responseStatusCodeintThe standard HTTP success status code (e.g., 200).
headersstringThe raw HTTP response headers from the server.
FieldValue
securityNone
capabilities["Network"]