2 min read

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

WebStreamClientState

WebStreamClientState describes the lifecycle state of a WebStreamClient connection, readable through the WebStreamClient.ConnectionState property.

A newly created WebStreamClient begins in the Connecting state. On a successful handshake the state advances to Open, after which messages can be received (and sent, for WebSocket connections). The connection terminates in either Closed (clean shutdown) or Error (unrecoverable failure). Listening to the WebStreamClient.Opened, WebStreamClient.Closed, and WebStreamClient.Error events is the recommended way to react to these transitions.

Items

NameValueDescription
Connecting0The client has sent a request to connect with the server and is waiting for a response.
Open1The client is connected to the server, allowing for data to be streamed between the server and client.
Error2An unrecoverable error has occured while setting up the connection orduring the connection lifetime, cutting off the stream.
Closed3The connection has run to completion without issues, either closed naturally by the server or manually by the user.

Connecting

The client has sent a request to connect with the server and is waiting for a response.

FieldValue
value0

Open

The client is connected to the server, allowing for data to be streamed between the server and client.

FieldValue
value1

Error

An unrecoverable error has occured while setting up the connection orduring the connection lifetime, cutting off the stream.

FieldValue
value2

Closed

The connection has run to completion without issues, either closed naturally by the server or manually by the user.

FieldValue
value3