Web Component: j-WebSocket
j-WebSocket
With this component, you can receive data via WebSocket. This component supports auto-reconnect to WebSocket when the connection is closed.
Configuration:
url
{String} URL for websocket, it can be relative or absolutereconnect
{Number} can contain only a number (milliseconds, default:2000
)bind
{Boolean} enables binding of value according to the componentpath
(default:false
)encoder
{Boolean} performs encode/decode messages viaURI
(default:false
)- NEW
message
{String} a link to methodfunction(msg)
- NEW
online
{String} a link to methodfunction(isonline)
Methods:
component.send(obj)
- sends JSON serialized object to the servercomponent.close()
- closes connectioncomponent.connect()
- opens connectioncomponent.idle(is)
- NEW can cancel/reopen connection
Events:
ON('message', function(data) {})
- received dataON('online', function(isOnline) {})
- online/offline
Author
- Peter Širka petersirka@gmail.com
- License
Created
28. july 2016
Updated
21. january 2023
Version
v1
License
https://www.totaljs.com/license/
Responsive
Yes
Author
Peter Širka
Email
petersirka@gmail.com