Feature #11076
open
Added by Carsten Rose over 3 years ago.
Updated over 3 years ago.
Description
Es soll moeglich sein via QFQ Daten zu einem Websocket zu senden und die Antwort abzufragen.
Benoetigt von SeminarLive um den MeetingManager IDs zu uebermitteln oder abzufragen.
Notation:
SELECT 'w:wss://antmedia.math.uzh.ch:6334/test|t:<payload>|lifetime:one' AS '_link|response1'
Evtl: Connection offen halten, persistent (resue innerhalb eines QFQ Laufes, oder via PHP Session ueber Stunden.
Library:
- Description updated (diff)
- Tracker changed from Support to Feature
- Status changed from New to In Progress
Test: https://github.com/bloatless/php-websocket
[root@webwork16]
$ cd /var/www/html/crose/php-websocket
$ git clone https://github.com/bloatless/php-websocket
$ cd php-websocket/cli
# Localhost ersetzen gegen 'webwork16' resp. '0.0.0.0' damit auch die Browseranwendungen funktionieren
client_demo.php: $clients[$i]->connect('192.168.133.84', 8000, '/demo', 'webwork16.math.uzh.ch');
server.php: $server->setAllowedOrigin('webwork16.math.uzh.ch');
server.php: $server = new \Bloatless\WebSocket\Server('0.0.0.0', 8000);
# Websocket Server starten
$ php server.php
# Status URL: http://webwork16.math.uzh.ch/crose/php-websocket/public/status.html
# Test URL: http://webwork16.math.uzh.ch/crose/php-websocket/public/index.html
Action: echo
Data: asljflaskjflasjfdlksaj
# save socket answer in {{col1}}, no output in 10.sql
10.sql = SELECT 'w:ws://webwork16.math.uzh.ch:8000/demo|t:{"action":"echo","data":"hello world"}' AS '_websocket|col1|_hide'
# Access socket answer via {{&col1:R}} ... the '&..' is necessary to access the answer/result, not the control string.
20.sql = SELECT "<br><br>-{{&col1:R}}="
- Description updated (diff)
Also available in: Atom
PDF