ws - interact with WebSocket clientsSYNOPSIS
ws register nameSTATUS
ws write index | name | * "text string"
ws exec index | name | * func arg
ws close [index | name | *]
When invoked with no arguments, ws prints details of all current WebSocket connections. The first number printed is the connection index that can be used in other commands to specify the connection over which an operation is to be performed.NOTES
Command ws register name notifies NAT32 that element name on the page that issued the command is to receive ws write, ws exec and ws close commands.
Command ws write sends the specified text to the WebSocket specified by index or name. The text will appear in the div element specified in the wsInit call of the page that created the WebSocket. If no WebSockets exist at the time, the text is printed on the CONSOLE device.
Command ws close closes the WebSocket specified by index or name. All existing WebSockets are closed if no index or name is specified or if * is specified.
NAT32 ws commands can be issued to any web client that has a WS entry in the WinSock sockets table. The special value * denotes all connections.
WebSockets are particularly useful when a web page invokes functionality that needs to convey information back to the page asynchronously. For example, when a VPN connection is established via a web page served by NAT32's HTTPD, the page will receive connection status information as it becomes available.
WebSockets can also be used to view NAT32 Monitor output on a client PC. The command set notify status will cause Monitor output to be sent to all current WebSockets for display in the client's status div. Note that the Monitor dialog box on the NAT32 machine must be enabled for this to work.
Open a WebSocket. Close the WebSocket. Display a string on all pages that have an open WebSocket.SEE ALSO
HTTPD, Monitor, Honeypot Monitor