Add args for production
This commit is contained in:
parent
a9beb8a467
commit
ca79e88b46
3 changed files with 11 additions and 9 deletions
6
app.js
6
app.js
|
|
@ -4,14 +4,16 @@ const https = require("https");
|
|||
const app = require("./index.js");
|
||||
const listener = require("./src/client.js");
|
||||
const { SniPrepare, SniListener } = require("./src/sni.js");
|
||||
const port80 = (process.argv.length >= 2 ? parseInt(process.argv[2]) : 0) || 80;
|
||||
const port443 = (process.argv.length >= 3 ? parseInt(process.argv[3]) : 0) || 443;
|
||||
|
||||
const main = async () => {
|
||||
await SniPrepare();
|
||||
const httpsServer = https.createServer({
|
||||
SNICallback: SniListener,
|
||||
}, listener);
|
||||
httpsServer.listen(443);
|
||||
app.listen(80);
|
||||
httpsServer.listen(port443);
|
||||
app.listen(port80);
|
||||
};
|
||||
|
||||
main().catch((err) => {
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue