Merge pull request #17 from p2p-org/prefer-http

prefer http option
This commit is contained in:
Vyacheslav Shebanov
2022-09-08 16:55:15 +03:00
committed by GitHub

View File

@@ -183,6 +183,9 @@ class UpstreamsConfigReader(
http.tls = authConfigReader.readClientTls(node) http.tls = authConfigReader.readClientTls(node)
} }
} }
getValueAsBool(connConfigNode, "prefer-http")?.let {
connection.preferHttp = it
}
getMapping(connConfigNode, "ws")?.let { node -> getMapping(connConfigNode, "ws")?.let { node ->
getValueAsString(node, "url")?.let { url -> getValueAsString(node, "url")?.let { url ->
val ws = UpstreamsConfig.WsEndpoint(URI(url)) val ws = UpstreamsConfig.WsEndpoint(URI(url))
@@ -256,7 +259,7 @@ class UpstreamsConfigReader(
} }
internal fun readUpstreamGrpc( internal fun readUpstreamGrpc(
upNode: MappingNode, upNode: MappingNode
) { ) {
if (hasAny(upNode, "chain")) { if (hasAny(upNode, "chain")) {
log.warn("Chain should be not applied to gRPC upstream") log.warn("Chain should be not applied to gRPC upstream")
@@ -309,7 +312,8 @@ class UpstreamsConfigReader(
}?.filterNotNull()?.toSet() ?: emptySet() }?.filterNotNull()?.toSet() ?: emptySet()
UpstreamsConfig.Methods( UpstreamsConfig.Methods(
enabled, disabled enabled,
disabled
) )
} }
} }