WebsocketClient (Component)

From Neos Wiki
Jump to navigation Jump to search
This page contains changes which are not marked for translation.

This article or section is a Stub. You can help the Neos Wiki by expanding it.

Websocket Client component as seen in the Scene Inspector


Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated
Enabled Bool Controls whether or not this component is enabled
URL Uri The Websocket server to target - either secure (wss://) or insecure (ws://)
User User The user who will be responsible for establishing the connection, and transmitting data.
_machineId String Automatically Assigned - The machineId of User
_userId String Automatically Assigned - The userId of User
AccessReason String A descriptive string explaining why this connection request should be granted
ConnectRetryInterval Float How often to retry the connection, if it fails for reasons other than being rejected by the user.
IsConnected Bool A read-only value indicating if this client has successfully connected to the target specified in URL


This component must be used in conjunction with the Websocket LogiX nodes - it only exists to store state, and does not function on its own.

User should be a user that expects to be hosting the Websocket connection Assignments should generally be made in the following order, depending on which one is the most applicable:

  • The user wearing the avatar containing this LogiX
  • A specifically defined user who is expected to be present for this connection to function
  • The user who spawned the object containing this LogiX
  • The user who is currently interacting with the object
  • The host of the session

You should not select a user who is not expecting the object to connect to an external service. It is possible they will deny the connection (especially if AccessReason isn't sufficiently convincing), which will cause the connection to fail.

AccessReason should provide a clear and concise reason for wanting to connect to the external service - It should include an obvious title or description of the object that is attempting to establish the connection, so that the user is aware of what item in the world is prompting the connection.

The object should have some way of indicating that it did not successfully connect to the target service, and that it will not function as intended, if at all.

The websocket times out and disconnects if the remote server does not send any traffic (including heartbeat messages) at least every 60 seconds, for long running connections be sure to configure the keepalive interval on the server side.


Related Issues

#430 - [Feature Request] Add WebSocket client LogiX node

#985 - Websocket: support binary data format

#1039 - Websocket disconnect

#1375 - Neos doesn't connect to outside websocket properly.

#1755 - Secure WebSockets fail to connect

#2470 - Websocket doesn't disconnect when not enabled

#2508 - Websockets don't emit last received message if the socket is closed right after that last message.

#2618 - WebSockets requiring secure connections (wss://) on headless clients

#3043 - Additional WebSocket connections on one User to the same destination are send-only

Related Components