[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: add support for ipv4 only system
From: |
gnunet |
Subject: |
[libeufin] branch master updated: add support for ipv4 only system |
Date: |
Tue, 01 Nov 2022 19:37:21 +0100 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 5822f89f add support for ipv4 only system
5822f89f is described below
commit 5822f89f770978303bfa2079854535b8e83831ec
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Tue Nov 1 15:35:53 2022 -0300
add support for ipv4 only system
---
.gitignore | 3 +++
nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 6 +++++-
.../src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt | 4 ++--
sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 10 +++++++---
4 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/.gitignore b/.gitignore
index c943cec6..150fa91b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
+/nexus/bin/
+/sandbox/bin/
+/util/bin/
nexus/libeufin-nexus-dev
sandbox/libeufin-sandbox-dev
configure
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 8be04d58..52bd0eab 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -59,6 +59,10 @@ class Serve : CliktCommand("Run nexus HTTP server") {
"--localhost-only",
help = "Bind only to localhost. On all interfaces otherwise"
).flag("--no-localhost-only", default = true)
+ private val ipv4Only by option(
+ "--ipv4-only",
+ help = "Bind only to ipv4"
+ ).flag(default = false)
// Prevent IPv6 mode:
// private val host by option().default("127.0.0.1")
private val port by option().int().default(5001)
@@ -80,7 +84,7 @@ class Serve : CliktCommand("Run nexus HTTP server") {
)
exitProcess(0)
}
- serverMain(port, localhostOnly)
+ serverMain(port, localhostOnly, ipv4Only)
}
}
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 ea019d6b..8c4e6dbe 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
@@ -1051,7 +1051,7 @@ val nexusApp: Application.() -> Unit = {
}
}
}
-fun serverMain(port: Int, localhostOnly: Boolean) {
+fun serverMain(port: Int, localhostOnly: Boolean, ipv4Only: Boolean) {
val server = embeddedServer(
Netty,
environment = applicationEngineEnvironment {
@@ -1059,7 +1059,7 @@ fun serverMain(port: Int, localhostOnly: Boolean) {
this.port = port
this.host = if (localhostOnly) "127.0.0.1" else "0.0.0.0"
}
- connector {
+ if (!ipv4Only) connector {
this.port = port
this.host = if (localhostOnly) "[::1]" else "[::]"
}
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index fb5504bf..6c069f2a 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -339,6 +339,10 @@ class Serve : CliktCommand("Run sandbox HTTP server") {
"--localhost-only",
help = "Bind only to localhost. On all interfaces otherwise"
).flag("--no-localhost-only", default = true)
+ private val ipv4Only by option(
+ "--ipv4-only",
+ help = "Bind only to ipv4"
+ ).flag(default = false)
private val logLevel by option()
private val port by option().int().default(5000)
private val withUnixSocket by option(
@@ -368,7 +372,7 @@ class Serve : CliktCommand("Run sandbox HTTP server") {
)
exitProcess(0)
}
- serverMain(port, localhostOnly)
+ serverMain(port, localhostOnly, ipv4Only)
}
}
@@ -1559,7 +1563,7 @@ val sandboxApp: Application.() -> Unit = {
}
}
-fun serverMain(port: Int, localhostOnly: Boolean) {
+fun serverMain(port: Int, localhostOnly: Boolean, ipv4Only: Boolean) {
val server = embeddedServer(
Netty,
environment = applicationEngineEnvironment{
@@ -1567,7 +1571,7 @@ fun serverMain(port: Int, localhostOnly: Boolean) {
this.port = port
this.host = if (localhostOnly) "127.0.0.1" else "0.0.0.0"
}
- connector {
+ if (!ipv4Only) connector {
this.port = port
this.host = if (localhostOnly) "[::1]" else "[::]"
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: add support for ipv4 only system,
gnunet <=