WebSocket (Socket function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 15: Line 15:
The Janus Web request must contain the required http headers to allow the upgrade to occur.
The Janus Web request must contain the required http headers to allow the upgrade to occur.


This function must be called from a Janus Web Server SOUL program. The Janus Web port must be enabled for Web Socket upgrades with the WEBSOCKET parameter. The WEBSOCKET option can be specified on either the port definition or the JANUS WEB rule for the URL.  
The Janus Web port must be enabled for Web Socket upgrades with the WEBSOCKET parameter. The WEBSOCKET option can be specified on either the port definition or the JANUS WEB rule for the URL.  


Any other usage will result in request cancellation.
Any other usage will result in request cancellation.

Revision as of 15:15, 13 August 2019

Convert Web thread to WebSocket thread (Socket class)

[Introduced in Model 204 7.8 βeta]


This page is under construction.

Syntax

%socket = [%(Socket):]WebSocket

Syntax terms

%outSocketSocket object
[%(Socket):] The optional class name in parentheses denotes a virtual constructor. See "Usage notes", below, for more information about invoking a virtual constructor.

Usage notes

This function will upgrade a Janus Web thread to use the WebSocket protocol for simple two-way data transfer between the http client and the server.

The Janus Web request must contain the required http headers to allow the upgrade to occur.

The Janus Web port must be enabled for Web Socket upgrades with the WEBSOCKET parameter. The WEBSOCKET option can be specified on either the port definition or the JANUS WEB rule for the URL.

Any other usage will result in request cancellation.

Examples

See also