SplitHTTP is now XHTTP

This commit is contained in:
2dust
2024-11-18 18:58:15 +08:00
parent 834c1ba63d
commit 41893d79c0
14 changed files with 35 additions and 33 deletions
@@ -6,6 +6,7 @@ enum class NetworkType(val type: String) {
WS("ws"),
HTTP_UPGRADE("httpupgrade"),
SPLIT_HTTP("splithttp"),
XHTTP("xhttp"),
HTTP("http"),
H2("h2"),
//QUIC("quic"),
@@ -206,7 +206,7 @@ data class V2rayConfig(
var kcpSettings: KcpSettingsBean? = null,
var wsSettings: WsSettingsBean? = null,
var httpupgradeSettings: HttpupgradeSettingsBean? = null,
var splithttpSettings: SplithttpSettingsBean? = null,
var xhttpSettings: XhttpSettingsBean? = null,
var httpSettings: HttpSettingsBean? = null,
var tlsSettings: TlsSettingsBean? = null,
var quicSettings: QuicSettingBean? = null,
@@ -275,7 +275,7 @@ data class V2rayConfig(
val acceptProxyProtocol: Boolean? = null
)
data class SplithttpSettingsBean(
data class XhttpSettingsBean(
var path: String? = null,
var host: String? = null,
val maxUploadSize: Int? = null,
@@ -396,12 +396,12 @@ data class V2rayConfig(
httpupgradeSettings = httpupgradeSetting
}
"splithttp" -> {
val splithttpSetting = SplithttpSettingsBean()
splithttpSetting.host = host.orEmpty()
sni = splithttpSetting.host
splithttpSetting.path = path ?: "/"
splithttpSettings = splithttpSetting
"splithttp","xhttp" -> {
val xhttpSetting = XhttpSettingsBean()
xhttpSetting.host = host.orEmpty()
sni = xhttpSetting.host
xhttpSetting.path = path ?: "/"
xhttpSettings = xhttpSetting
}
"h2", "http" -> {
@@ -581,12 +581,12 @@ data class V2rayConfig(
)
}
"splithttp" -> {
val splithttpSetting = streamSettings?.splithttpSettings ?: return null
"splithttp" ,"xhttp"-> {
val xhttpSettings = streamSettings?.xhttpSettings ?: return null
listOf(
"",
splithttpSetting.host,
splithttpSetting.path
xhttpSettings.host,
xhttpSettings.path
)
}
@@ -55,7 +55,7 @@ open class FmtBase {
config.seed.let { if (it.isNotNullEmpty()) dicQuery["seed"] = it.orEmpty() }
}
NetworkType.WS, NetworkType.HTTP_UPGRADE, NetworkType.SPLIT_HTTP -> {
NetworkType.WS, NetworkType.HTTP_UPGRADE, NetworkType.SPLIT_HTTP, NetworkType.XHTTP -> {
config.host.let { if (it.isNotNullEmpty()) dicQuery["host"] = it.orEmpty() }
config.path.let { if (it.isNotNullEmpty()) dicQuery["path"] = it.orEmpty() }
}
@@ -185,7 +185,7 @@ class ServerActivity : BaseActivity() {
"tcp" -> R.string.server_lab_request_host_http
"ws" -> R.string.server_lab_request_host_ws
"httpupgrade" -> R.string.server_lab_request_host_httpupgrade
"splithttp" -> R.string.server_lab_request_host_splithttp
"splithttp","xhttp" -> R.string.server_lab_request_host_xhttp
"h2" -> R.string.server_lab_request_host_h2
//"quic" -> R.string.server_lab_request_host_quic
"grpc" -> R.string.server_lab_request_host_grpc
@@ -200,7 +200,7 @@ class ServerActivity : BaseActivity() {
"kcp" -> R.string.server_lab_path_kcp
"ws" -> R.string.server_lab_path_ws
"httpupgrade" -> R.string.server_lab_path_httpupgrade
"splithttp" -> R.string.server_lab_path_splithttp
"splithttp","xhttp" -> R.string.server_lab_path_xhttp
"h2" -> R.string.server_lab_path_h2
//"quic" -> R.string.server_lab_path_quic
"grpc" -> R.string.server_lab_path_grpc