diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-08-06 12:57:55 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-08-06 12:57:55 +0100 |
| commit | 31569d1a78a0731ef9efc7d462ec39acd428d588 (patch) | |
| tree | 8a17373f8b950c2e93872da293216e359403595b /app/websocket/spotify.ts | |
| parent | ccb8ef7183e6d7af7bde4bb398c27379fdc7089f (diff) | |
Add spotify page
Diffstat (limited to 'app/websocket/spotify.ts')
| -rw-r--r-- | app/websocket/spotify.ts | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/app/websocket/spotify.ts b/app/websocket/spotify.ts deleted file mode 100644 index 4b81fe0..0000000 --- a/app/websocket/spotify.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Server } from 'http'; -import { WebSocketServer } from 'ws'; -import { SpotifyClient } from '../spotify/client.js'; - -export const createWebsocketServer = (server: Server): WebSocketServer => { - const wss = new WebSocketServer({ noServer: true }); - server.on('upgrade', (req, socket, head) => { - wss.handleUpgrade(req, socket, head, (ws) => { - wss.emit('connection', ws, req) - }) - }) - - wss.on('connection', (ws) => { - SpotifyClient.addClient(ws); - }); - - return wss; -} |
