Answer: Yes, you can send text from the application to the web page. WebSocket works by the very principle of server and client through TCP / IP. Just a shell created at the TCP / IP level and built a new data format that is defined by the IETF. Detailed information on the data format is available at: [ https://tools.ietf.org/html/rfc6455:51[1]
The server accepts a web socket connection if requested in the correct format. A client is a web application in which javascript objects are defined exclusively for this purpose in HTML5.
Easy to use APIs:
Programming client-side websites is very easy using new APIs and objects.
API (events) available to the developer: onopen, onclose, onmessage. All these functions must be defined by the java script developers.
onopen: the function is called when the server successfully accepts connections
onclose: function called when socket connection is closed
onmessage: the function is called when data is received from the server.
send: the function is not event-based, but should be started when the client has information to exchange with the server.
source share