refactor: add new setting core.relayPort to override core.port for reverse proxies. core.port will be used by plugins, but core.relayPort may be used by core
This commit is contained in:
parent
ca7ba89dd7
commit
7e17b477bd
|
@ -26,6 +26,7 @@ switch (os.platform()) {
|
||||||
config.inject({
|
config.inject({
|
||||||
"core.confDir": configDir,
|
"core.confDir": configDir,
|
||||||
"core.port": 8080,
|
"core.port": 8080,
|
||||||
|
"core.relayPort": 0,
|
||||||
"core.appPort": 80,
|
"core.appPort": 80,
|
||||||
"core.logLevel": "info",
|
"core.logLevel": "info",
|
||||||
"core.pluginDir": path.resolve(configDir, "..", "plugins"),
|
"core.pluginDir": path.resolve(configDir, "..", "plugins"),
|
||||||
|
|
|
@ -29,5 +29,11 @@ export async function start() {
|
||||||
relay(dht, new Stream(false, connection.socket));
|
relay(dht, new Stream(false, connection.socket));
|
||||||
});
|
});
|
||||||
|
|
||||||
await relayServer.listen({ port: config.uint("core.port"), host: "0.0.0.0" });
|
let port = config.uint("core.relayPort");
|
||||||
|
|
||||||
|
if (!port) {
|
||||||
|
port = config.uint("core.port");
|
||||||
|
}
|
||||||
|
|
||||||
|
await relayServer.listen({ port, host: "0.0.0.0" });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue