Project

General

Profile

Feature #11076

SELECT ... AS _websocket

Added by Carsten Rose 11 months ago. Updated 11 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
Target version:
Start date:
27.08.2020
Due date:
% Done:

0%

Estimated time:
Discuss:

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:

#1

Updated by Carsten Rose 11 months ago

  • Description updated (diff)
#2

Updated by Carsten Rose 11 months ago

  • Tracker changed from Support to Feature
#3

Updated by Carsten Rose 11 months ago

  • 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
#4

Updated by Carsten Rose 11 months ago

# 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}}="  
#5

Updated by Carsten Rose 11 months ago

  • Description updated (diff)

Also available in: Atom PDF