Skip to content

Technical Plugin YPTSocket

Daniel Neto edited this page Oct 29, 2026 · 1 revision

Technical: YPTSocket plugin

Provides real-time socket integration and event notifications.

Audience: developers, advanced administrators and AI-assisted diagnosis. Plugin catalog.

Source baseline

  • Review date: 2026-10-29. Method: static source analysis; runtime/provider behavior was not exercised.
  • Code ownership: AVideo Streamer repository.
  • Reported version: 2.3.
  • Source revision: 7d48f2dfc0289236718a3f9fba7c5ffecff4a37f.
  • Entry class file: YPTSocket.php.

Confirm the installed plugin version independently of the Streamer version. Configuration defaults below are not a dump of this installation's saved settings.

Dependencies

No literal dependency declaration was extracted. This does not prove the plugin is standalone.

Hook integration

Override Implementation
updateScript() YPTSocket.php:56
getDataObjectDeprecated() YPTSocket.php:69
getDataObjectAdvanced() YPTSocket.php:81
getFooterCode() YPTSocket.php:141
getHeadCode() YPTSocket.php:285
onUserSocketConnect() YPTSocket.php:420
onUserSocketDisconnect() YPTSocket.php:431
getPluginMenu() YPTSocket.php:479
executeEveryDay() YPTSocket.php:499
getChannelPageButtons($users_id) YPTSocket.php:531

Configuration assignments

These are direct assignments inside getEmptyDataObject(), not evaluated effective defaults. Stored plugins.object_data, globals, structured values and conditional branches may alter runtime behavior. Private/default credential values are omitted.

Field Literal default or expression type Literal source label/help Evidence
forceNonSecure false Force not to use wss (non secure): This is good if a reverse proxy is giving you a SSL source
port "2053" Server Port: You also MUST open this port on the firewall source
uri "0.0.0.0" Server URI: You should not change it, only if you know what you are doing source
host Computed/structured; inspect source Server host: If your site is HTTPS make sure this host also handle the SSL connection source
debugSocket true Show server debugger to admin: This will show a panel with some socket informations to the ADMIN user only source
debugAllUsersSocket false Show server debugger to all: Same as above but will show the panel to all users source
server_crt_file Computed/structured; inspect source SSL Certificate File: If your site use HTTPS, you MUST provide one source
server_key_file Private setting; value omitted SSL Certificate Key File: If your site use HTTPS, you MUST provide one source
allow_self_signed true Allow self signed certs: Should be unchecked in production source
showTotalOnlineUsersPerVideo true Show Total Online Users Per Video source
showTotalOnlineUsersPerLive true Show Total Online Users Per Live source
showTotalOnlineUsersPerLiveLink true Show Total Online Users Per LiveLink source
enableCalls false Enable Meeting Calls: This feature requires the meet plugin enabled source
socketIO true — source

Files and request surface

This inventory distinguishes implementation files from an API specification. Includes, templates, callbacks and CLI workers are not interchangeable HTTP endpoints. Request-field names below are direct source references, not a complete schema or permission declaration.

File Source role Direct request fields observed
Message.php class/helper implementation —
MessageSQLite.php class/helper implementation —
MessageSQLiteV2.php class/helper implementation —
YPTSocket.php plugin entry class —
callUser.php PHP page/include/worker; inspect caller users_id
caller.js browser/worker JavaScript; verify loader —
crontab.php PHP page/include/worker; inspect caller —
db.php PHP page/include/worker; inspect caller —
footer.php PHP page/include/worker; inspect caller —
footerCaller.php PHP page/include/worker; inspect caller —
functions.php class/helper implementation webSocketLiveKey, webSocketSelfURI, webSocketVideos_id
getWebSocket.json.php JSON entry point; inspect caller and guard —
restart.json.php JSON entry point; inspect caller and guard —
script.js browser/worker JavaScript; verify loader —
send.json.php JSON entry point; inspect caller and guard —
server.node.php PHP page/include/worker; inspect caller —
server.php PHP page/include/worker; inspect caller —
server.php.php PHP page/include/worker; inspect caller —
server2.php PHP page/include/worker; inspect caller —
server3.php PHP page/include/worker; inspect caller —
serverCertbot.php PHP page/include/worker; inspect caller —
serverRestart.php PHP page/include/worker; inspect caller —
setSocketConfig.json.php JSON entry point; inspect caller and guard —
socketInfo.js browser/worker JavaScript; verify loader —
sql.sql schema/migration SQL —
stopServer.php PHP page/include/worker; inspect caller —
test.php class/helper implementation —
userOnlineLabel.php PHP page/include/worker; inspect caller —
worker.php PHP page/include/worker; inspect caller APISecret

Data and migrations

Tables named in available CREATE TABLE statements: connections. Apply installation/update behavior through the owning plugin; this reference is not a script for running historical migrations manually.

Main-file named symbols

Visibility and implementation semantics must be checked in source. Nonempty string defaults are represented as . This is a symbol reference, not a stable public API promise.

Function or method Source
getDescription() 21
getName() 36
getUUID() 41
getPluginVersion() 46
getServerVersion() 51
updateScript() 56
getDataObjectDeprecated() 69
getDataObjectAdvanced() 81
getEmptyDataObject() 97
getFooterCode() 141
getSocketJS() 147
getCallerJS() 153
sendAsync($msg, $callbackJSFunction = "'<string>''<string>'") 159
cleanupSocketSendObj($data, $maxSize = 2048) 176
sendIO($msg, $callbackJSFunction = "'<string>''<string>'") 198
getHeadCode() 285
send($msg, $callbackJSFunction = "'<string>''<string>'") 299
sendOLD($msg, $callbackJSFunction = "'<string>''<string>'") 309
getWebSocketURL($isCommandLine = false, $webSocketToken = '', $internalDocker = false) 398
onUserSocketConnect() 420
onUserSocketDisconnect() 431
getUserOnlineLabel($users_id, $class = ''<string>'') 441
shouldShowCaller() 451
scheduleRestart() 473
getPluginMenu() 479
restart() 486
executeEveryDay() 499
getStartServerCommand() 505
getChannelPageButtons($users_id) 531

Supporting PHP declarations

These symbols are grouped by source file; inspect the class declaration and visibility before calling them.

Message.php

Declared classes: Message.

Named symbol Source
__construct($loop) 23
onOpen(ConnectionInterface $conn) 34
setTimeout(ConnectionInterface $conn) 135
removeAutoEvalCodeOnHTMLRecursive(&$data) 146
onClose(ConnectionInterface $conn) 160
onMessage(ConnectionInterface $from, $msg) 205
shouldPropagateInfo($client) 277
msgToResourceId($msg, $resourceId, $type = "") 287
onError(ConnectionInterface $conn, \Exception $e) 365
msgToUsers_id($msg, $users_id, $type = "") 375
msgToSelfURI($msg, $pattern, $type = "") 404
getTotals($_client) 421
getLivesTotal() 501
isLiveUsersEnabled() 533
msgToDevice_id($msg, $yptDeviceId) 541
msgToAll(ConnectionInterface $from, $msg, $type = "", $includeMe = false) 555
msgToAllSameVideo($videos_id, $msg) 562
msgToAllSameLive($live_key, $msg) 580
msgToArray(&$json) 603
makeSureIsArray($msg) 608
getTags() 625
isUserLive($users_id) 629
_log_message($msg, $type = "") 635

MessageSQLite.php

Declared classes: Message.

Named symbol Source
__construct() 33
onOpen(ConnectionInterface $conn) 39
onClose(ConnectionInterface $conn) 152
setClient(ConnectionInterface $conn, $client) 171
unsetClient(ConnectionInterface $conn, $client) 187
getTotalFromVars() 204
getTotals() 222
onMessage(ConnectionInterface $from, $msg) 240
removeAutoEvalCodeOnHTMLRecursive(&$data) 288
shouldPropagateInfo($row) 302
getShouldPropagateInfoLastMessage() 316
msgToResourceId($msg, $resourceId, $type = "", $totals = array()) 321
onError(ConnectionInterface $conn, \Exception $e) 415
msgToUsers_id($msg, $users_id, $type = "") 420
msgToSelfURI($msg, $pattern, $type = "") 448
getLivesTotal() 462
isLiveUsersEnabled() 480
msgToAll(ConnectionInterface $from, $msg, $type = "", $includeMe = false) 488
msgToAllLogged(ConnectionInterface $from, $msg, $type = "", $includeMe = false) 518
msgToAllSameVideo($videos_id, $msg) 538
msgToAllSameLive($live_key, $live_servers_id, $msg) 556
msgToArray(&$json) 576
makeSureIsArray($msg) 581
getTags() 598
isUserLive($users_id) 602
isValidSelfURI($selfURI) 606
_log_message($msg, $type = "") 621

MessageSQLiteV2.php

Declared classes: Message.

Named symbol Source
__construct() 38
onOpen(ConnectionInterface $conn) 46
onClose(ConnectionInterface $conn) 170
removeAutoEvalCodeOnHTMLRecursive(&$data) 190
setClient(ConnectionInterface $conn, $client) 205
unsetClient(ConnectionInterface $conn, $client) 222
getTotalFromVars() 240
getTotals() 259
onMessage(ConnectionInterface $from, $msg) 278
isDeviceCommandLine($yptDeviceId) 330
shouldPropagateInfo($row) 335
getShouldPropagateInfoLastMessage() 353
msgToResourceId($msg, $resourceId, $type = "", $totals = array()) 359
onError(ConnectionInterface $conn, \Exception $e) 462
msgToUsers_id($msg, $users_id, $type = "") 480
msgToSelfURI($msg, $pattern, $type = "") 509
getLivesTotal() 524
isLiveUsersEnabled() 543
msgToAll($msg, $type = \SocketMessageType::UNDEFINED) 552
initPeriodicTask() 557
_msgToAll($msg, $type = "") 575
msgToAllSameVideo($videos_id, $msg) 686
msgToAllSameLive($live_key, $live_servers_id, $msg) 705
msgToArray(&$json) 730
makeSureIsArray($msg) 736
getTags() 754
isUserLive($users_id) 759
isValidSelfURI($selfURI) 764
_log_message($msg, $type = "") 779

db.php

Named symbol Source
dbInsertConnection($array) 19
dbGetRowFromResourcesId($resourceId) 75
dbDeleteConnection($resourceId) 84
dbGetAll() 90
dbGetTotalInVideos() 98
dbGetTotalInLive() 108
dbGetTotalInLiveLink() 118
dbGetClassToUpdate() 128
dbGetAllResourcesIdFromUsersId($users_id) 148
dbGetAllResourceIdFromSelfURI($selfURI) 157
dbGetAllResourceIdAndSelfURI() 173
dbGetAllResourcesIdFromVideosId($videos_id) 186
dbGetAllResourcesIdFromLive($live_key, $live_servers_id) 195
dbGetDBTotals() 204
dbGetTotalUniqueDevices() 267
dbGetTotalConnections() 278
dbGetUniqueUsers() 288
dbGetTotalUniqueUsers() 302
dbGetTotalPerVideosId() 307
dbIsUserOnLine($users_id) 318

functions.php

Declared classes: SocketMessageType.

Named symbol Source
getEncryptedInfo($timeOut = 0, $send_to_uri_pattern = "", $sentFrom = '<string>') 3
getDecryptedInfo($string) 49
verifyTokenSocket($token) 65
getTotalViewsLive_key($live_key) 104
killProcessOnPort() 123
restartServer($kill=true) 140
restartServerIfIsDead() 154

server.node.php

Named symbol Source
downloadURL($url, $timeout = 60) 40
killStalePhpWorkers() 81

server.php.php

Named symbol Source
riseSQLiteError() 39
findValidCertificate($url) 63
isCertificateValid($certPath) 92

server3.php

Named symbol Source
broadcastMessages($server, $clients, $messages) 11

test.php

Declared classes: AVideoSocketConfiguration.

Named symbol Source
isPortOpen($host, $port) 75
isDomainResolving($domain) 85
_test_send($SocketURL, $msg) 95
_test_getEncryptedInfo($msg) 143
_log($msg) 165
__construct($wss, $port, $host, $success, $message = '') 178
log() 191
getSecureText() 212
toURL() 224
isLocalhost() 228
isSecure() 235
printIfComplete() 241
checkSSL($host) 270

worker.php

Named symbol Source
getUserFromDatabase($userId) 163

Diagnostics and validation

  1. Check the installed/enabled version and the dependencies/settings above.
  2. Identify the actual failing page, request, callback or worker and correlate its timestamp with the AVideo log.
  3. Follow the linked method and caller. Check business-state changes and output artifacts as well as HTTP status.
  4. Reproduce the relevant workflow in a test environment. External provider, Encoder, live-server, storage, payment and authenticated flows require their real integrations.

Shared diagnostic workflow. This page is not a security audit or a claim of end-to-end validation.

Clone this wiki locally