Project

General

Profile

Actions

Feature #11076

open

SELECT ... AS _websocket

Added by Carsten Rose over 3 years ago. Updated over 3 years ago.

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

0%

Estimated time:
Discuss:
Prio Planung:
Vote:

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:


Related issues

Related to QFQ - Feature #13354: Using Websocket in QFQNewCarsten Rose10.11.2021

Actions
Actions #1

Updated by Carsten Rose over 3 years ago

  • Description updated (diff)
Actions #2

Updated by Carsten Rose over 3 years ago

  • Tracker changed from Support to Feature
Actions #3

Updated by Carsten Rose over 3 years 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
Actions #4

Updated by Carsten Rose over 3 years 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}}="  
Actions #5

Updated by Carsten Rose over 3 years ago

  • Description updated (diff)
Actions #6

Updated by Carsten Rose almost 2 years ago

Actions

Also available in: Atom PDF