WebSocketSessionStrategy

Strategy for handling WebSocket connections

Constructor

new WebSocketSessionStrategy(session, sdk)

Create a new WebSocket strategy instance

Parameters:
NameTypeDescription
sessionSession

The session instance

sdkAssisfySDK

The SDK instance

Members

sdk :AssisfySDK

session :Session

Type:

sessionId :string

Type:
  • string

websocket :WebSocket

Type:
  • WebSocket

Methods

close(code, reason)

Close the WebSocket connection

Parameters:
NameTypeDescription
codenumber

The close code

reasonstring

The reason for closing

handleInput(inputopt)

Handle user input

Parameters:
NameTypeAttributesDefaultDescription
inputstring<optional>
''

The user input

handlePermissionRequest(grantedopt)

Handle a permission request

Parameters:
NameTypeAttributesDefaultDescription
grantedboolean<optional>
false

Whether to grant the permission