// needs a function O webServe(S uri, SS params) { ... } switchable int httpPort = 80; switchable int httpsPort = 443; transient autoDispose MyHTTPD httpServer; transient autoDispose MyHTTPD httpsServer; transient bool redirectHttpToHttps; transient new HTTPSpamBlocker1 spamBlocker; void start_webServers(File keyStore, S passphrase) { start_webServers(serveHttps_makeSSLSocketFactory(keyStore, passphrase)); } void start_webServers(SSLServerSocketFactory sslSocketFactory) ctex { if (httpPort != 0) { httpServer = new MyHTTPD(httpPort); httpServer.enter = lambda0 enter; httpServer.serveFunction = func(S uri, SS parms) { redirectHttpToHttps && !startsWith(uri, "/.well-known/") ? serveRedirect("https://" + serveHttp_domainName() + (httpsPort == 443 ? "" : ":" + httpsPort) + uri) : webServe(uri, parms) }; httpServer.start(); print("HTTP server started on port " + httpServer.getPort()); } if (httpsPort == 0 || sslSocketFactory == null) ret; httpsServer = new MyHTTPD(httpsPort); httpsServer.enter = lambda0 enter; httpsServer.makeSecure(sslSocketFactory); httpsServer.serveFunction = func(S uri, SS parms) { webServe(uri, parms) }; httpsServer.start(); print("HTTPS server started on port " + httpsServer.getPort()); }
Began life as a copy of #1026245
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment