summary refs log tree commit diff
path: root/webrtc/src/Server.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2022-08-13 02:00:50 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-13 22:00:55 +0200
commit5e86d7ab9c5200d794c3adb2b422d20a2aefd2ce (patch)
tree0a4b23ee96862077b21dea20cf71205709e15f7c /webrtc/src/Server.ts
parenttry to update build script (diff)
downloadserver-5e86d7ab9c5200d794c3adb2b422d20a2aefd2ce.tar.xz
restructure to single project
Diffstat (limited to 'webrtc/src/Server.ts')
-rw-r--r--webrtc/src/Server.ts46
1 files changed, 0 insertions, 46 deletions
diff --git a/webrtc/src/Server.ts b/webrtc/src/Server.ts
deleted file mode 100644

index 3199b9c1..00000000 --- a/webrtc/src/Server.ts +++ /dev/null
@@ -1,46 +0,0 @@ -import { Server as WebSocketServer } from "ws"; -import { Config, db } from "@fosscord/util"; -import mediasoup from "mediasoup"; - -let port = Number(process.env.PORT); -if (isNaN(port)) port = 3004; - -export class Server { - public ws: WebSocketServer; - public turn: any; - - constructor() { - this.ws = new WebSocketServer({ - port, - maxPayload: 4096, - }); - this.ws.on("connection", (socket) => { - socket.on("message", (message) => { - socket.emit( - JSON.stringify({ - op: 2, - d: { - ssrc: 1, - ip: "127.0.0.1", - port: 3004, - modes: [ - "xsalsa20_poly1305", - "xsalsa20_poly1305_suffix", - "xsalsa20_poly1305_lite", - ], - heartbeat_interval: 1, - }, - }) - ); - }); - }); - } - - async listen(): Promise<void> { - // @ts-ignore - await (db as Promise<Connection>); - await Config.init(); - console.log("[DB] connected"); - console.log(`[WebRTC] online on 0.0.0.0:${port}`); - } -}