mirror of
https://git.tuxpa.in/a/code-server.git
synced 2024-12-27 04:35:25 +00:00
Bypass certificates on bypass auth
This commit is contained in:
parent
8327da8d00
commit
94edbd59e9
@ -77,6 +77,10 @@ export const createApp = async (options: CreateAppOptions): Promise<{
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isEncrypted = (socket: net.Socket): boolean => {
|
const isEncrypted = (socket: net.Socket): boolean => {
|
||||||
|
if (options.bypassAuth) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line:no-any
|
// tslint:disable-next-line:no-any
|
||||||
return (socket as any).encrypted;
|
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 });
|
const wss = new ws.Server({ server });
|
||||||
|
|
||||||
wss.shouldHandle = (req): boolean => {
|
wss.shouldHandle = (req): boolean => {
|
||||||
|
Loading…
Reference in New Issue
Block a user