ZK AU Engine

From Documentation
Revision as of 11:47, 13 April 2022 by Hawk (talk | contribs) (→‎WebSocket)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


WebSocket

Since 8.5.0

  • Available for ZK:
  • http://www.zkoss.org/product/zkhttp://www.zkoss.org/whyzk/zkeeVersion ee.png


By default, ZK communicates with a server in XMLHttpRequest or Fetch API asynchronously. Now you can switch to WebSocket. Then WebSocketEndPoint handles ping/pong messages from and to the client. This feature works only for browsers that support WebSocket natively.

To enable WebSocket connection, add the following listener into zk.xml

<listener>
	<listener-class>org.zkoss.zkmax.au.websocket.WebSocketWebAppInit</listener-class>
</listener>

To change the URL pattern, please refer to this library property.

When WebSocket connection is enabled, ZK will use WebSocketServerPush by default when server-push started.

Note that we cannot guarantee the accessing of the information provided by HTTP requests when a WebSocket connection is enabled.



Last Update : 2022/04/13

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.