This commit is contained in:
2dust
2021-04-02 16:36:29 +08:00
committed by yuhan6665
parent dd2d2c1638
commit 9642b7f64f
5 changed files with 25 additions and 10 deletions

View File

@@ -123,7 +123,7 @@ data class V2rayConfig(
var tlsSettings: TlsSettingsBean? = null,
var quicSettings: QuicSettingBean? = null,
var xtlsSettings: TlsSettingsBean? = null,
val grpcSettings: Any? = null,
var grpcSettings: GrpcSettingsBean? = null,
val dsSettings: Any? = null,
val sockopt: Any? = null
) {
@@ -187,6 +187,8 @@ data class V2rayConfig(
data class HeaderBean(var type: String = "none")
}
data class GrpcSettingsBean(var serviceName: String = "")
fun populateTransportSettings(transport: String, headerType: String?, host: String?, path: String?, seed: String?,
quicSecurity: String?, key: String?): String {
var sni = ""
@@ -241,6 +243,12 @@ data class V2rayConfig(
quicsetting.header.type = headerType ?: "none"
quicSettings = quicsetting
}
"grpc" -> {
val grpcSetting = GrpcSettingsBean()
grpcSetting.serviceName = path ?: ""
sni = host ?: ""
grpcSettings = grpcSetting
}
}
return sni
}
@@ -342,6 +350,12 @@ data class V2rayConfig(
quicSetting.security,
quicSetting.key)
}
"grpc" -> {
val grpcSetting = streamSettings?.grpcSettings ?: return null
listOf("",
"",
grpcSetting.serviceName)
}
else -> null
}
}

View File

@@ -43,10 +43,10 @@
<string name="server_lab_network">传输协议(network)</string>
<string name="server_lab_more_function">功能设置(不清楚则保持默认值)</string>
<string name="server_lab_head_type">伪装类型(type)</string>
<string name="server_lab_request_host">伪装域名host(host/ws host/h2 host)/QUIC 加密方式</string>
<string name="server_lab_path">path(ws path/h2 path)/QUIC 加密密钥</string>
<string name="server_lab_stream_security">底层传输安全</string>
<string name="server_lab_allow_insecure">allowInsecure</string>
<string name="server_lab_request_host">伪装域名(host)(host/ws host/h2 host)/QUIC 加密方式</string>
<string name="server_lab_path">path(ws path/h2 path)/QUIC 加密密钥/kcp seed/grpc serviceName</string>
<string name="server_lab_stream_security">底层传输安全(tls)</string>
<string name="server_lab_allow_insecure">跳过证书验证(allowInsecure)</string>
<string name="server_lab_address3">服务器地址</string>
<string name="server_lab_port3">服务器端口</string>
<string name="server_lab_id3">密码</string>

View File

@@ -43,10 +43,10 @@
<string name="server_lab_network">網路</string>
<string name="server_lab_more_function">更多功能</string>
<string name="server_lab_head_type">標頭類型</string>
<string name="server_lab_request_host">要求主機(host/ws host/h2 host)/QUIC加密方式</string>
<string name="server_lab_path">path(ws path/h2 path)/QUIC加密密鑰</string>
<string name="server_lab_stream_security">傳輸層安全性</string>
<string name="server_lab_allow_insecure">allowInsecure</string>
<string name="server_lab_request_host">要求主機(host)(host/ws host/h2 host)/QUIC加密方式</string>
<string name="server_lab_path">path(ws path/h2 path)/QUIC加密密鑰/kcp seed/grpc serviceName</string>
<string name="server_lab_stream_security">傳輸層安全性(tls)</string>
<string name="server_lab_allow_insecure">跳過證書驗證(allowInsecure)</string>
<string name="server_lab_address3">伺服器位址</string>
<string name="server_lab_port3">伺服器埠</string>
<string name="server_lab_id3">密碼</string>

View File

@@ -24,6 +24,7 @@
<item>ws</item>
<item>h2</item>
<item>quic</item>
<item>grpc</item>
</string-array>
<string-array name="headertypes" translatable="false">

View File

@@ -44,7 +44,7 @@
<string name="server_lab_more_function">more function</string>
<string name="server_lab_head_type">head type</string>
<string name="server_lab_request_host">request host(host/ws host/h2 host)/QUIC security</string>
<string name="server_lab_path">path(ws path/h2 path)/QUIC key</string>
<string name="server_lab_path">path(ws path/h2 path)/QUIC key/kcp seed/grpc serviceName</string>
<string name="server_lab_stream_security">tls</string>
<string name="server_lab_allow_insecure">allowInsecure</string>
<string name="server_lab_address3">address</string>