summary refs log tree commit diff
path: root/src/Server.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:50:29 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:50:29 +0200
commitdb14548bd4a5281f9a6e103cdc3ae1848c625ab4 (patch)
tree6f947eb6277c61c16c3488fcffa4e256bf4ed65c /src/Server.ts
parentMerge branch 'webrtc' (diff)
downloadserver-db14548bd4a5281f9a6e103cdc3ae1848c625ab4.tar.xz
:sparkles: webrtc
Diffstat (limited to 'src/Server.ts')
-rw-r--r--src/Server.ts43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/Server.ts b/src/Server.ts
deleted file mode 100644
index bb82e659..00000000
--- a/src/Server.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { Server as WebSocketServer } from "ws";
-import { Config, db } from "@fosscord/server-util";
-import mediasoup from "mediasoup"
-
-var 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}`);
-	}
-}