Skip to content

Commit

Permalink
Merge pull request #1717 from yuhan6665/xtls-rv
Browse files Browse the repository at this point in the history
Add xtls rprx vision
  • Loading branch information
2dust authored Oct 29, 2022
2 parents 866ceae + 1794ae4 commit f2720ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ data class V2rayConfig(
const val DEFAULT_SECURITY = "auto"
const val DEFAULT_LEVEL = 8
const val DEFAULT_NETWORK = "tcp"
const val DEFAULT_FLOW = "xtls-rprx-splice"

const val TLS = "tls"
const val XTLS = "xtls"
Expand Down
12 changes: 3 additions & 9 deletions V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import com.v2ray.ang.R
import com.v2ray.ang.dto.EConfigType
import com.v2ray.ang.dto.ServerConfig
import com.v2ray.ang.dto.V2rayConfig
import com.v2ray.ang.dto.V2rayConfig.Companion.DEFAULT_FLOW
import com.v2ray.ang.dto.V2rayConfig.Companion.DEFAULT_PORT
import com.v2ray.ang.dto.V2rayConfig.Companion.XTLS
import com.v2ray.ang.extension.toast
import com.v2ray.ang.util.MmkvManager
import com.v2ray.ang.util.MmkvManager.ID_MAIN
Expand Down Expand Up @@ -285,11 +283,7 @@ class ServerActivity : BaseActivity() {
vnext.users[0].security = securitys[sp_security?.selectedItemPosition ?: 0]
} else if (config.configType == EConfigType.VLESS) {
vnext.users[0].encryption = et_security?.text.toString().trim()
if (streamSecuritys[sp_stream_security?.selectedItemPosition ?: 0] == XTLS) {
vnext.users[0].flow = flows[sp_flow?.selectedItemPosition ?: 0].ifBlank { DEFAULT_FLOW }
} else {
vnext.users[0].flow = ""
}
vnext.users[0].flow = flows[sp_flow?.selectedItemPosition ?: 0]
}
}

Expand All @@ -311,8 +305,8 @@ class ServerActivity : BaseActivity() {
} else if (config.configType == EConfigType.TROJAN) {
server.password = et_id.text.toString().trim()
server.flow =
if (streamSecuritys[sp_stream_security?.selectedItemPosition ?: 0] == XTLS) {
flows[sp_flow?.selectedItemPosition ?: 0].ifBlank { DEFAULT_FLOW }
if (streamSecuritys[sp_stream_security?.selectedItemPosition ?: 0] == V2rayConfig.XTLS) {
flows[sp_flow?.selectedItemPosition ?: 0]
} else {
""
}
Expand Down
2 changes: 2 additions & 0 deletions V2rayNG/app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
<item>xtls-rprx-direct-udp443</item>
<item>xtls-rprx-splice</item>
<item>xtls-rprx-splice-udp443</item>
<item>xtls-rprx-vision</item>
<item>xtls-rprx-vision-udp443</item>
</string-array>


Expand Down

0 comments on commit f2720ac

Please # to comment.