By default, when the app has user authentication enabled, Soketi disconnects unauthenticated or unauthorized connections in 30 seconds. However, you can change this duration using the following environment variable:
1
# 5 seconds timeout
2
USER_AUTHENTICATION_TIMEOUT=5000 soketi start
Copied!
Send message to specific user ID
With the help of the new HTTP API endpoint, Soketi can also allow you to send a message specific to an user id. This feature is implemented on all SDKs and you can see a JS sample below.
The SDKs namings differ, so ensure you use the latest SDK version for your language.
1
pusher.sendToUser('1','order-shipped',{
2
id:'A2BQW2',
3
items:[{
4
name:'Iphone',
5
}],
6
});
Copied!
Terminate specific user's connections
Soketi supports terminating a user's connections after it was authenticated. It stays in sync with Pusher's protocol and most of the SDKs are already implementing a method for this functionality. Ensure you use the latest SDK version for your language.