Update hello world

This commit is contained in:
Chocobozzz 2022-11-16 15:34:52 +01:00
parent be83d13c23
commit fa9005ab1b
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 14 additions and 11 deletions

View File

@ -178,15 +178,18 @@ async function register ({
}, 1000)
})
registerWebSocketRoute({
route: '/toto',
// Backward compatibility
if (registerWebSocketRoute) {
registerWebSocketRoute({
route: '/toto',
handler: (request, socket, head) => {
wss.handleUpgrade(request, socket, head, ws => {
wss.emit('connection', ws, request)
})
}
})
handler: (request, socket, head) => {
wss.handleUpgrade(request, socket, head, ws => {
wss.emit('connection', ws, request)
})
}
})
}
}
async function unregister () {

View File

@ -1,12 +1,12 @@
{
"name": "peertube-plugin-hello-world",
"version": "0.0.21",
"version": "0.0.22",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "peertube-plugin-hello-world",
"version": "0.0.21",
"version": "0.0.22",
"dependencies": {
"ws": "^8.9.0"
}

View File

@ -1,6 +1,6 @@
{
"name": "peertube-plugin-hello-world",
"version": "0.0.21",
"version": "0.0.22",
"description": "Hello world PeerTube plugin example",
"engine": {
"peertube": ">=3.2.0"