Skip to content

Commit 9a3969e

Browse files
committed
Bypass certificates on bypass auth
1 parent b06dccd commit 9a3969e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/server/src/server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ export const createApp = async (options: CreateAppOptions): Promise<{
7777
};
7878

7979
const isEncrypted = (socket: net.Socket): boolean => {
80+
if (options.bypassAuth) {
81+
return true;
82+
}
83+
8084
// tslint:disable-next-line:no-any
8185
return (socket as any).encrypted;
8286
};
@@ -125,7 +129,7 @@ export const createApp = async (options: CreateAppOptions): Promise<{
125129
});
126130
});
127131

128-
const server = httpolyglot.createServer(options.httpsOptions || certs, app) as http.Server;
132+
const server = httpolyglot.createServer(options.bypassAuth ? {} : options.httpsOptions || certs, app) as http.Server;
129133
const wss = new ws.Server({ server });
130134

131135
wss.shouldHandle = (req): boolean => {

0 commit comments

Comments
 (0)