Skip to content

Commit

Permalink
fix: fix bug for generate httpupgrade in v2raytransport
Browse files Browse the repository at this point in the history
  • Loading branch information
Misaka-blog committed Nov 1, 2023
1 parent 06a20d0 commit f839b26
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
10 changes: 9 additions & 1 deletion app/src/main/java/io/nekohasekai/sagernet/fmt/v2ray/V2RayFmt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ fun StandardV2RayBean.toUriVMessVLESSTrojan(isTrojan: Boolean): String {

when (type) {
"tcp" -> {}
"ws", "http" -> {
"ws", "http", "httpupgrade" -> {
if (host.isNotBlank()) {
builder.addQueryParameter("host", host)
}
Expand Down Expand Up @@ -582,6 +582,14 @@ fun buildSingBoxOutboundStreamSettings(bean: StandardV2RayBean): V2RayTransportO
service_name = bean.path
}
}

"httpupgrade" -> {
return V2RayTransportOptions_HTTPUpgradeOptions().apply {
type = "httpupgrade"
host = bean.host
path = bean.path
}
}
}

// if (needKeepAliveInterval) {
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/java/moe/matsuri/nb4a/SingBoxOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -4585,4 +4585,13 @@ public static class V2RayTransportOptions_GRPCOptions extends V2RayTransportOpti

}

public static class V2RayTransportOptions_HTTPUpgradeOptions extends V2RayTransportOptions {

public String host;

public String path;


}

}
2 changes: 1 addition & 1 deletion buildScript/lib/core/get_source_env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if [ ! -z $ENV_NB4A ]; then
export COMMIT_SING_BOX_EXTRA="2f8e1bdb842ec2138c1699101a84950617c3cbb8"
export COMMIT_SING_BOX_EXTRA="5e69e4d38b195721b9e991c88d64ecdf9dcc51c5"
fi

if [ ! -z $ENV_SING_BOX_EXTRA ]; then
Expand Down

0 comments on commit f839b26

Please sign in to comment.