From 94edbd59e920646d43e4082876f7ddeafaf9653f Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Thu, 28 Feb 2019 16:06:17 -0600 Subject: [PATCH] Bypass certificates on bypass auth --- packages/server/src/server.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/server/src/server.ts b/packages/server/src/server.ts index bd7134c0..ece7c654 100644 --- a/packages/server/src/server.ts +++ b/packages/server/src/server.ts @@ -77,6 +77,10 @@ export const createApp = async (options: CreateAppOptions): Promise<{ }; const isEncrypted = (socket: net.Socket): boolean => { + if (options.bypassAuth) { + return true; + } + // tslint:disable-next-line:no-any return (socket as any).encrypted; }; @@ -125,7 +129,7 @@ export const createApp = async (options: CreateAppOptions): Promise<{ }); }); - const server = httpolyglot.createServer(options.httpsOptions || certs, app) as http.Server; + const server = httpolyglot.createServer(options.bypassAuth ? {} : options.httpsOptions || certs, app) as http.Server; const wss = new ws.Server({ server }); wss.shouldHandle = (req): boolean => {