Jump to navigation Jump to search
50 bytes added ,  09:34, 10 August 2018
no edit summary
* <code>websocket:id</code> returns your current session id. You can use all [[Session Module]] and [[Sessions Module]] functions within the websocket context.
<pre class="brush:xquery">
* First of all: include the websocket module
* The <code>$ws:connect("/")</code> annotation gets called if a client successfully creates a websocket to the path "/"(checkout [[WebSockets]] for further information).
* Get the <code>client-id</code> and the <code>client-path</code> with <code>websocket:id()</code> and <code>websocket:path()</code>
* Create a json-result
* Broadcast the result to all connected clients without the calling client
administrator, editor


Navigation menu