Skip to content

Commit

Permalink
feat: port hopping delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Oct 25, 2023
1 parent 4c4a3b8 commit 9fcb430
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -519,13 +519,14 @@ object RawUpdater : GroupUpdater() {
"hysteria2" -> {
val bean = HysteriaBean()
bean.protocolVersion = 2
var hopPorts = ""
for (opt in proxy) {
if (opt.value == null) continue
when (opt.key.replace("_", "-")) {
"name" -> bean.name = opt.value.toString()
"server" -> bean.serverAddress = opt.value as String
"port" -> bean.serverPorts = opt.value.toString()
// "ports" -> hopPorts = opt.value.toString()
"ports" -> hopPorts = opt.value.toString()

"obfs-password" -> bean.obfuscation = opt.value.toString()

Expand All @@ -543,6 +544,9 @@ object RawUpdater : GroupUpdater() {
opt.value.toString().substringBefore(" ").toIntOrNull() ?: 0
}
}
if (hopPorts.isNotBlank()) {
bean.serverPorts = hopPorts
}
proxies.add(bean)
}

Expand Down

0 comments on commit 9fcb430

Please sign in to comment.