Skip to content

Commit

Permalink
Allow http1 for frontend HTTPS2 as well (backend always did).
Browse files Browse the repository at this point in the history
  • Loading branch information
TekMonksGitHub committed Dec 11, 2023
1 parent 2aacefa commit 97e6f85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build_number
Original file line number Diff line number Diff line change
@@ -1 +1 @@
770
771
2 changes: 1 addition & 1 deletion frontend/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function bootstrap() {
/* Start HTTP/S server */
const listener = async (req, res) => { try{await _handleRequest(req, res);} catch(e){error.error(e.stack?e.stack.toString():e.toString()); _sendError(req,res,500,e);} }
const options = conf.ssl ? {key: fs.readFileSync(conf.sslKeyFile), cert: fs.readFileSync(conf.sslCertFile)} : null;
const httpd = options && (!conf.forceHTTP1) ? http2.createSecureServer(options, listener) : options ? https.createServer(options, listener) : http.createServer(listener); // create server for http2 or http1 based on configurations
const httpd = options && (!conf.forceHTTP1) ? http2.createSecureServer({...options, allowHTTP1: true}, listener) : options ? https.createServer(options, listener) : http.createServer(listener); // create server for http2 or http1 based on configurations
const hostinterface = os.platform!="darwin"?(conf.host||"::"):"::"; // Mac won't let app bind to lower ports unless it listens to the wildcard host
httpd.setTimeout(conf.timeout);
httpd.listen(conf.port, hostinterface);
Expand Down

0 comments on commit 97e6f85

Please sign in to comment.