Add support for gRPC protocol
Signed-off-by: Teddysun <i@teddysun.com>
This commit is contained in:
parent
c6e649c2a3
commit
9605f980e0
2 changed files with 7 additions and 1 deletions
|
@ -50,6 +50,8 @@ class ConfigFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChange
|
|||
"websocket-http" -> Pair(null, false)
|
||||
"websocket-tls" -> Pair(null, true)
|
||||
"quic-tls" -> Pair("quic", false)
|
||||
"grpc" -> Pair("grpc", false)
|
||||
"grpc-tls" -> Pair("grpc", true)
|
||||
else -> {
|
||||
check(false)
|
||||
Pair(null, false)
|
||||
|
@ -70,7 +72,9 @@ class ConfigFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChange
|
|||
fun onInitializePluginOptions(options: PluginOptions) {
|
||||
mode.value = when {
|
||||
options["mode"] ?: "websocket" == "quic" -> "quic-tls"
|
||||
"tls" in options -> "websocket-tls"
|
||||
options["mode"] == "websocket-tls" -> "websocket-tls"
|
||||
options["mode"] == "grpc" -> "grpc"
|
||||
options["mode"] == "grpc-tls" -> "grpc-tls"
|
||||
else -> "websocket-http"
|
||||
}.also { onPreferenceChange(null, it) }
|
||||
host.text = options["host"] ?: "cloudfront.com"
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
<item>websocket-http</item>
|
||||
<item>websocket-tls</item>
|
||||
<item>quic-tls</item>
|
||||
<item>grpc</item>
|
||||
<item>grpc-tls</item>
|
||||
</string-array>
|
||||
<string-array name="loglevels">
|
||||
<item>debug</item>
|
||||
|
|
Loading…
Reference in a new issue