Skip to content

Commit

Permalink
Delete splithttp
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Nov 30, 2024
1 parent 59a710b commit 6fc9803
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
1 change: 0 additions & 1 deletion V2rayNG/app/src/main/java/com/v2ray/ang/dto/NetworkType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ enum class NetworkType(val type: String) {
KCP("kcp"),
WS("ws"),
HTTP_UPGRADE("httpupgrade"),
SPLIT_HTTP("splithttp"),
XHTTP("xhttp"),
HTTP("http"),
H2("h2"),
Expand Down
4 changes: 2 additions & 2 deletions V2rayNG/app/src/main/java/com/v2ray/ang/dto/V2rayConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ data class V2rayConfig(
httpupgradeSettings = httpupgradeSetting
}

NetworkType.SPLIT_HTTP.type, NetworkType.XHTTP.type -> {
NetworkType.XHTTP.type -> {
val xhttpSetting = XhttpSettingsBean()
xhttpSetting.host = host.orEmpty()
sni = host
Expand Down Expand Up @@ -596,7 +596,7 @@ data class V2rayConfig(
)
}

NetworkType.SPLIT_HTTP.type, NetworkType.XHTTP.type -> {
NetworkType.XHTTP.type -> {
val xhttpSettings = streamSettings?.xhttpSettings ?: return null
listOf(
"",
Expand Down
4 changes: 1 addition & 3 deletions V2rayNG/app/src/main/java/com/v2ray/ang/fmt/FmtBase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ open class FmtBase {

fun getItemFormQuery(config: ProfileItem, queryParam: Map<String, String>, allowInsecure: Boolean) {
config.network = queryParam["type"] ?: NetworkType.TCP.type
//TODO
if (config.network == NetworkType.SPLIT_HTTP.type) config.network = NetworkType.XHTTP.type
config.headerType = queryParam["headerType"]
config.host = queryParam["host"]
config.path = queryParam["path"]
Expand Down Expand Up @@ -95,7 +93,7 @@ open class FmtBase {
config.path.let { if (it.isNotNullEmpty()) dicQuery["path"] = it.orEmpty() }
}

NetworkType.SPLIT_HTTP, NetworkType.XHTTP -> {
NetworkType.XHTTP -> {
config.host.let { if (it.isNotNullEmpty()) dicQuery["host"] = it.orEmpty() }
config.path.let { if (it.isNotNullEmpty()) dicQuery["path"] = it.orEmpty() }
config.xhttpMode.let { if (it.isNotNullEmpty()) dicQuery["mode"] = it.orEmpty() }
Expand Down
14 changes: 7 additions & 7 deletions V2rayNG/app/src/main/java/com/v2ray/ang/ui/ServerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ class ServerActivity : BaseActivity() {
sp_header_type_title?.text =
when (networks[position]) {
NetworkType.GRPC.type -> getString(R.string.server_lab_mode_type)
NetworkType.SPLIT_HTTP.type, NetworkType.XHTTP.type -> getString(R.string.server_lab_xhttp_mode)
NetworkType.XHTTP.type -> getString(R.string.server_lab_xhttp_mode)
else -> getString(R.string.server_lab_head_type)
}.orEmpty()
sp_header_type?.setSelection(
Utils.arrayFind(
types,
when (networks[position]) {
NetworkType.GRPC.type -> config?.mode
NetworkType.SPLIT_HTTP.type, NetworkType.XHTTP.type -> config?.xhttpMode
NetworkType.XHTTP.type -> config?.xhttpMode
else -> config?.headerType
}.orEmpty()
)
Expand Down Expand Up @@ -198,7 +198,7 @@ class ServerActivity : BaseActivity() {
NetworkType.TCP.type -> R.string.server_lab_request_host_http
NetworkType.WS.type -> R.string.server_lab_request_host_ws
NetworkType.HTTP_UPGRADE.type -> R.string.server_lab_request_host_httpupgrade
NetworkType.SPLIT_HTTP.type, NetworkType.XHTTP.type -> R.string.server_lab_request_host_xhttp
NetworkType.XHTTP.type -> R.string.server_lab_request_host_xhttp
NetworkType.H2.type -> R.string.server_lab_request_host_h2
//"quic" -> R.string.server_lab_request_host_quic
NetworkType.GRPC.type -> R.string.server_lab_request_host_grpc
Expand All @@ -213,7 +213,7 @@ class ServerActivity : BaseActivity() {
NetworkType.KCP.type -> R.string.server_lab_path_kcp
NetworkType.WS.type -> R.string.server_lab_path_ws
NetworkType.HTTP_UPGRADE.type -> R.string.server_lab_path_httpupgrade
NetworkType.SPLIT_HTTP.type, NetworkType.XHTTP.type -> R.string.server_lab_path_xhttp
NetworkType.XHTTP.type -> R.string.server_lab_path_xhttp
NetworkType.H2.type -> R.string.server_lab_path_h2
//"quic" -> R.string.server_lab_path_quic
NetworkType.GRPC.type -> R.string.server_lab_path_grpc
Expand All @@ -223,14 +223,14 @@ class ServerActivity : BaseActivity() {
)
et_extra?.text = Utils.getEditable(
when (networks[position]) {
NetworkType.SPLIT_HTTP.type, NetworkType.XHTTP.type -> config?.xhttpExtra
NetworkType.XHTTP.type -> config?.xhttpExtra
else -> null
}.orEmpty()
)

layout_extra?.visibility =
when (networks[position]) {
NetworkType.SPLIT_HTTP.type, NetworkType.XHTTP.type -> View.VISIBLE
NetworkType.XHTTP.type -> View.VISIBLE
else -> View.GONE
}
}
Expand Down Expand Up @@ -578,7 +578,7 @@ class ServerActivity : BaseActivity() {
grpcModes
}

NetworkType.SPLIT_HTTP.type, NetworkType.XHTTP.type -> {
NetworkType.XHTTP.type -> {
xhttpMode
}

Expand Down
1 change: 0 additions & 1 deletion V2rayNG/app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<item>ws</item>
<item>httpupgrade</item>
<item>xhttp</item>
<item>splithttp</item>
<item>h2</item>
<item>grpc</item>
</string-array>
Expand Down

0 comments on commit 6fc9803

Please sign in to comment.