diff options
Diffstat (limited to 'index.js')
-rwxr-xr-x | index.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/index.js b/index.js index 444d579..b0db6cd 100755 --- a/index.js +++ b/index.js @@ -12,6 +12,13 @@ const processSmartPlaylist = require('./smart-playlist') const setupClient = require('./client') const { + makeSocketServer, + makeSocketClient, + attachBackendToSocketClient, + attachSocketServerToBackend +} = require('./socket') + +const { getItemPathString, updatePlaylistFormat } = require('./playlist-utils') @@ -67,6 +74,8 @@ async function main() { }, 'player-options': {type: 'series'}, 'stress-test': {type: 'flag'}, + 'socket-client': {type: 'value'}, + 'socket-server': {type: 'flag'}, 'telnet-server': {type: 'flag'}, [parseOptions.handleDashless](option) { playlistSources.push(option) @@ -138,6 +147,22 @@ async function main() { appElement.attachAsServerHost(telnetServer) } + let socketServer + if (options['socket-server']) { + socketServer = makeSocketServer() + attachSocketServerToBackend(socketServer, backend) + socketServer.listen(1255) + } + + let socketClient + if (options['socket-client']) { + socketClient = makeSocketClient() + attachBackendToSocketClient(backend, socketClient, { + getPlaylistSources: () => appElement.playlistSources + }) + socketClient.socket.connect(1255) + } + if (options['stress-test']) { await loadPlaylistPromise |