INNER CODE UNIT · JavaScript
handleServerUpgrade
iamlukethedev/Hermes3D · server/index.js:107
const handleServerUpgrade = (req, socket, head) => {
if (resolvePathname(req.url) === "/api/gateway/ws") {
proxy.handleUpgrade(req, socket, head);
return;
}
handleUpgrade(req, socket, head);
};
const httpsCert = useHttps ? await generateHttpsCert() : null;
const createServer = () =>
useHttps
? https.createServer(httpsCert, (req, res) => {
if (accessGate.handleHttp(req, res)) return;
handle(req, res);
})
: http.createServer((req, res) => {
if (accessGate.handleHttp(req, res)) return;