diff options
author | MS <ms@taler.net> | 2022-09-28 20:22:11 +0200 |
---|---|---|
committer | MS <ms@taler.net> | 2022-09-28 20:25:07 +0200 |
commit | 9d87533ef9e43679ec5e84188042afb6f42283fb (patch) | |
tree | 12bf1f43cc3d523ed7a6ce8b7998d3d57315be9e /nexus/src/main/kotlin/tech/libeufin/nexus/server | |
parent | cecb1db5d4b8fc64a6762a5c0d1e69f45c2a7acc (diff) | |
download | libeufin-9d87533ef9e43679ec5e84188042afb6f42283fb.tar.gz libeufin-9d87533ef9e43679ec5e84188042afb6f42283fb.tar.bz2 libeufin-9d87533ef9e43679ec5e84188042afb6f42283fb.zip |
Optionally listen to all interfaces.
Diffstat (limited to 'nexus/src/main/kotlin/tech/libeufin/nexus/server')
-rw-r--r-- | nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt index 4f1abc81..ea019d6b 100644 --- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt +++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt @@ -1051,17 +1051,17 @@ val nexusApp: Application.() -> Unit = { } } } -fun serverMain(port: Int) { +fun serverMain(port: Int, localhostOnly: Boolean) { val server = embeddedServer( Netty, environment = applicationEngineEnvironment { connector { this.port = port - this.host = "127.0.0.1" + this.host = if (localhostOnly) "127.0.0.1" else "0.0.0.0" } connector { this.port = port - this.host = "[::1]" + this.host = if (localhostOnly) "[::1]" else "[::]" } module(nexusApp) } |