summary refs log tree commit diff
path: root/src/gateway/events/Connection.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-26 22:29:30 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-26 22:41:21 +1000
commitdbaf39237ae3a41b6b1ac6a6cd3486129599b815 (patch)
tree350cca4889d0804445eddbd8467d274b27307776 /src/gateway/events/Connection.ts
parentRemove the cdn storage location log (diff)
downloadserver-dbaf39237ae3a41b6b1ac6a6cd3486129599b815.tar.xz
Prettier
Diffstat (limited to 'src/gateway/events/Connection.ts')
-rw-r--r--src/gateway/events/Connection.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gateway/events/Connection.ts b/src/gateway/events/Connection.ts
index bed3cf44..8747e3ad 100644
--- a/src/gateway/events/Connection.ts
+++ b/src/gateway/events/Connection.ts
@@ -21,10 +21,12 @@ try {
 export async function Connection(
 	this: WS.Server,
 	socket: WebSocket,
-	request: IncomingMessage
+	request: IncomingMessage,
 ) {
 	const forwardedFor = Config.get().security.forwadedFor;
-	const ipAddress = forwardedFor ? request.headers[forwardedFor] as string : request.socket.remoteAddress;
+	const ipAddress = forwardedFor
+		? (request.headers[forwardedFor] as string)
+		: request.socket.remoteAddress;
 
 	socket.ipAddress = ipAddress;
 
@@ -33,7 +35,9 @@ export async function Connection(
 		socket.on("close", Close);
 		// @ts-ignore
 		socket.on("message", Message);
-		console.log(`[Gateway] New connection from ${socket.ipAddress}, total ${this.clients.size}`);
+		console.log(
+			`[Gateway] New connection from ${socket.ipAddress}, total ${this.clients.size}`,
+		);
 
 		const { searchParams } = new URL(`http://localhost${request.url}`);
 		// @ts-ignore
@@ -41,7 +45,7 @@ export async function Connection(
 		if (!["json", "etf"].includes(socket.encoding)) {
 			if (socket.encoding === "etf" && erlpack) {
 				throw new Error(
-					"Erlpack is not installed: 'npm i @yukikaze-bot/erlpack'"
+					"Erlpack is not installed: 'npm i @yukikaze-bot/erlpack'",
 				);
 			}
 			return socket.close(CLOSECODES.Decode_error);