Advanced Features

WebSockets

6min
brightsign players fully support websocket protocol through node js® players can act as either the websocket server, the websocket client, or host both sides to the communication the url the client connects to when establishing its connection with the websocket server is set statically the server and client both have knowledge of the ip address for the websocket client below are two examples for establishing websocket communication on brightsign players github example follow the instructions at https //github com/brightsign/websocket test https //github com/brightsign/websocket test to establish a websocket connection on a brightsign player when performed properly, the autorun brs file will automatically establish a node js environment on the player, as well as the websocket server and websocket client the websocket client then sends a message to the websocket server on the machine, and the server prints a message on the display npm example the following example requires knowledge of npm and creating plugins for brightsign players download the websocketsample zip file below using npm, run npm install in the directory run node node server js for the websocket server open the index html file in a browser to establish a connection click on the "click me" button to send a message back to the websocket server https //archbee doc uploads s3 amazonaws com/tyaqenq txckpox4eakhe nwijapeyfup7chrkgh9k1 20250418 155310 zip this example establishes a websocket connection on the active machine in order to perform this on a brightsign player, a plugin must be used it is recommended that the plugin uses bsmessageport to act as a pipeline between itself and javascript for more info, plugins & parsers docid\ uwsz22b8bpjf6dqq ioq2 remote dws and websocket brightsign players running brightsignos 8 0 x and later maintain a persistent websocket connection to the brightsign websocket server this connection allows for bsn cloud functionality where authorized users can view and modify player settings in real time over the internet server side security the brightsign websocket server implements a permissions model that ties each player to a single bsn cloud network via the player serial number only a person with the proper network credentials can perform remote dws calls through the websockets server credentials are validated using the same oauth 2 0 server as other bsn cloud applications the websocket server validates all client data before processing to prevent malicious attacks client side security communication between the websocket server and brightsign players is carried out using the secure websocket protocol ( wss\ // ) messages are encrypted to prevent man in the middle attacks against the player or server the authenticity of the client (player) is validated using the same oauth 2 0 server as other bsn cloud applications the brightsign player validates all server data before using it to affect player settings data from the websockets server can also be passed along to an internal udp port for processing by the client brightscript / javascript application