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
| Name | Type / Returns | Description |
|---|---|---|
| WebStreamClient.ConnectionState | WebStreamClientState | The current WebStreamClientState of the client. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.ClassName | string | A read-only string representing the class this Object belongs to. |
| Object.className | string |
WebStreamClient.ConnectionState
The current WebStreamClientState of the client.
| Field | Value |
|---|---|
| type | WebStreamClientState |
| tags | ["ReadOnly","NotReplicated"] |
| security | {"read":"None","write":"None"} |
| thread safety | ReadSafe |
| category | Data |
| serialization | {"can_load":false,"can_save":true} |
| capabilities | ["Network"] |
Methods
| Name | Type / Returns | Description |
|---|---|---|
| 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
| Name | Type / Returns | Description |
|---|---|---|
| Object:GetPropertyChangedSignal | RBXScriptSignal | Get an event that fires when a given property of the object changes. |
| Object:IsA | boolean | Returns true if an object's class matches or inherits from a given class. |
| Object:isA | boolean |
WebStreamClient:Close
Closes the client, aborting the ongoing request. If successful, fires the WebStreamClient.Closed event.
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| 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
| Name | Type | Default | Description |
|---|---|---|---|
| data | string | Text string to send to the server. |
Returns
| Type | Description |
|---|---|
| () |
| Field | Value |
|---|---|
| security | None |
| thread safety | Unsafe |
| capabilities | ["Network"] |
Events
| Name | Type / Returns | Description |
|---|---|---|
| WebStreamClient.Closed | Fires when the streaming connection is closed, either by the server or by a call to WebStreamClient:Close(). | |
| WebStreamClient.Error | Fires if an error is received while establishing the connection or during the connection lifetime. | |
| WebStreamClient.MessageReceived | Fires each time a message is received from the server. | |
| WebStreamClient.Opened | Fires when the a connection is successfully established between the client and server, allowing for events to begin streaming. |
Inherited from Object
| Name | Type / Returns | Description |
|---|---|---|
| Object.Changed | Fires 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()
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Network"] |
WebStreamClient.Error
Fires if an error is received while establishing the connection or during the connection lifetime.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| responseStatusCode | int | The standard HTTP error status code (e.g., 404, 500). | |
| errorMessage | string | A descriptive message containing details about the error. |
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Network"] |
WebStreamClient.MessageReceived
Fires each time a message is received from the server. The format differs based on the WebStreamClientType.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| message | string | The message data payload received from the server stream. |
| Field | Value |
|---|---|
| security | None |
| 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
| Name | Type | Default | Description |
|---|---|---|---|
| responseStatusCode | int | The standard HTTP success status code (e.g., 200). | |
| headers | string | The raw HTTP response headers from the server. |
| Field | Value |
|---|---|
| security | None |
| capabilities | ["Network"] |