mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 06:30:05 +08:00
feat: Add supports for HTTPUpgrade
This commit is contained in:
parent
a82e5b4f2c
commit
e805fe7ab9
@ -14,7 +14,7 @@ public abstract class StandardV2RayBean extends AbstractBean {
|
||||
|
||||
//////// End of VMess & VLESS ////////
|
||||
|
||||
// "V2Ray Transport" tcp/http/ws/quic/grpc
|
||||
// "V2Ray Transport" tcp/http/ws/quic/grpc/httpupgrade
|
||||
public String type;
|
||||
|
||||
public String host;
|
||||
@ -133,6 +133,11 @@ public abstract class StandardV2RayBean extends AbstractBean {
|
||||
case "grpc": {
|
||||
output.writeString(path);
|
||||
}
|
||||
case "httpupgrade": {
|
||||
output.writeString(host);
|
||||
output.writeString(path);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
output.writeString(security);
|
||||
@ -180,6 +185,10 @@ public abstract class StandardV2RayBean extends AbstractBean {
|
||||
case "grpc": {
|
||||
path = input.readString();
|
||||
}
|
||||
case "httpupgrade": {
|
||||
host = input.readString();
|
||||
path = input.readString();
|
||||
}
|
||||
}
|
||||
|
||||
security = input.readString();
|
||||
|
||||
@ -116,6 +116,15 @@ fun parseV2Ray(link: String): StandardV2RayBean {
|
||||
bean.path = it
|
||||
}
|
||||
}
|
||||
|
||||
"httpupgrade" -> {
|
||||
url.queryParameter("path")?.let {
|
||||
bean.path = it
|
||||
}
|
||||
url.queryParameter("host")?.let {
|
||||
bean.host = it
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// also vless format
|
||||
@ -215,6 +224,15 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
|
||||
path = it
|
||||
}
|
||||
}
|
||||
|
||||
"httpupgrade" -> {
|
||||
url.queryParameter("host")?.let {
|
||||
host = it
|
||||
}
|
||||
url.queryParameter("path")?.let {
|
||||
path = it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// maybe from matsuri vmess exoprt
|
||||
|
||||
@ -170,6 +170,12 @@ abstract class StandardV2RaySettingsActivity : ProfileSettingsActivity<StandardV
|
||||
path.preference.setTitle(R.string.grpc_service_name)
|
||||
path.preference.isVisible = true
|
||||
}
|
||||
"httpupgrade" -> {
|
||||
host.preference.setTitle("HTTPUpgrade Host")
|
||||
path.preference.setTitle("HTTPUpgrade Path")
|
||||
host.preference.isVisible = true
|
||||
path.preference.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2447,6 +2447,16 @@ public class SingBoxOptions {
|
||||
|
||||
}
|
||||
|
||||
public static class V2RayHTTPUpgradeOptions extends SingBoxOption {
|
||||
|
||||
public String host;
|
||||
|
||||
public String path;
|
||||
|
||||
public Map<String, String> headers;
|
||||
|
||||
}
|
||||
|
||||
public static class VLESSInboundOptions extends SingBoxOption {
|
||||
|
||||
// Generate note: nested type ListenOptions
|
||||
|
||||
@ -263,6 +263,7 @@
|
||||
<item>http</item>
|
||||
<item>quic</item>
|
||||
<item>grpc</item>
|
||||
<item>httpupgrade</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="trojan_go_networks_entry">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user