mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
hysteria -> hysteria2
This commit is contained in:
@@ -64,7 +64,6 @@ https://matsuridayo.github.io
|
||||
- Trojan
|
||||
- TUIC ( sing-box )
|
||||
- NaïveProxy ( Custom Core )
|
||||
- Hysteria ( Custom Core or sing-box )
|
||||
- Hysteria2 ( Custom Core or sing-box )
|
||||
- Custom Outbound
|
||||
- Custom Config
|
||||
|
||||
@@ -184,8 +184,6 @@ namespace NekoGui {
|
||||
bean = new NekoGui_fmt::TrojanVLESSBean(NekoGui_fmt::TrojanVLESSBean::proxy_VLESS);
|
||||
} else if (type == "naive") {
|
||||
bean = new NekoGui_fmt::NaiveBean();
|
||||
} else if (type == "hysteria") {
|
||||
bean = new NekoGui_fmt::QUICBean(NekoGui_fmt::QUICBean::proxy_Hysteria);
|
||||
} else if (type == "hysteria2") {
|
||||
bean = new NekoGui_fmt::QUICBean(NekoGui_fmt::QUICBean::proxy_Hysteria2);
|
||||
} else if (type == "tuic") {
|
||||
|
||||
@@ -191,22 +191,7 @@ namespace NekoGui_fmt {
|
||||
{"tls", coreTlsObj},
|
||||
};
|
||||
|
||||
if (proxy_type == proxy_Hysteria) {
|
||||
outbound["type"] = "hysteria";
|
||||
outbound["obfs"] = obfsPassword;
|
||||
outbound["disable_mtu_discovery"] = disableMtuDiscovery;
|
||||
outbound["recv_window"] = streamReceiveWindow;
|
||||
outbound["recv_window_conn"] = connectionReceiveWindow;
|
||||
outbound["up_mbps"] = uploadMbps;
|
||||
outbound["down_mbps"] = downloadMbps;
|
||||
|
||||
if (!hopPort.trimmed().isEmpty()) {
|
||||
outbound["hop_ports"] = hopPort;
|
||||
outbound["hop_interval"] = hopInterval;
|
||||
}
|
||||
if (authPayloadType == hysteria_auth_base64) outbound["auth"] = authPayload;
|
||||
if (authPayloadType == hysteria_auth_string) outbound["auth_str"] = authPayload;
|
||||
} else if (proxy_type == proxy_Hysteria2) {
|
||||
if (proxy_type == proxy_Hysteria2) {
|
||||
outbound["type"] = "hysteria2";
|
||||
outbound["password"] = password;
|
||||
outbound["up_mbps"] = uploadMbps;
|
||||
|
||||
@@ -36,46 +36,26 @@ namespace NekoGui_fmt {
|
||||
}
|
||||
|
||||
int QUICBean::NeedExternal(bool isFirstProfile) {
|
||||
auto hysteriaCore = [=] {
|
||||
auto extCore = [=] {
|
||||
if (isFirstProfile) {
|
||||
if (NekoGui::dataStore->spmode_vpn && hyProtocol != hysteria_protocol_facktcp && hopPort.trimmed().isEmpty()) {
|
||||
if (NekoGui::dataStore->spmode_vpn && hopPort.trimmed().isEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
} else {
|
||||
if (hyProtocol == hysteria_protocol_facktcp || !hopPort.trimmed().isEmpty()) {
|
||||
if (!hopPort.trimmed().isEmpty()) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
};
|
||||
|
||||
auto hysteria2Core = [=] {
|
||||
if (isFirstProfile) {
|
||||
if (NekoGui::dataStore->spmode_vpn) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
};
|
||||
|
||||
auto tuicCore = [=] {
|
||||
if (isFirstProfile) {
|
||||
if (NekoGui::dataStore->spmode_vpn) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
};
|
||||
|
||||
if (!forceExternal && (proxy_type == proxy_TUIC || hyProtocol == hysteria_protocol_udp)) {
|
||||
if (!forceExternal && (proxy_type == proxy_TUIC || hopPort.trimmed().isEmpty())) {
|
||||
// sing-box support
|
||||
return 0;
|
||||
} else {
|
||||
// hysteria core support
|
||||
return hysteriaCore();
|
||||
// external core support
|
||||
return extCore();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,68 +213,11 @@ namespace NekoGui_fmt {
|
||||
WriteTempFile("hysteria2_" + GetRandomString(10) + ".json", result.config_export.toUtf8());
|
||||
result.arguments = QStringList{"-c", TempFile};
|
||||
|
||||
return result;
|
||||
|
||||
} else { // Hysteria
|
||||
ExternalBuildResult result{NekoGui::dataStore->extraCore->Get("hysteria")};
|
||||
|
||||
QJsonObject config;
|
||||
|
||||
// determine server format
|
||||
auto is_direct = external_stat == 2;
|
||||
auto sniGen = sni;
|
||||
if (sni.isEmpty() && !IsIpAddress(serverAddress)) sniGen = serverAddress;
|
||||
|
||||
auto server = serverAddress;
|
||||
if (!hopPort.trimmed().isEmpty()) {
|
||||
server = WrapIPV6Host(server) + ":" + hopPort;
|
||||
} else {
|
||||
server = WrapIPV6Host(server) + ":" + Int2String(serverPort);
|
||||
}
|
||||
config["server"] = is_direct ? server : "127.0.0.1:" + Int2String(mapping_port);
|
||||
|
||||
// listen
|
||||
config["socks5"] = QJsonObject{
|
||||
{"listen", "127.0.0.1:" + Int2String(socks_port)},
|
||||
};
|
||||
|
||||
// misc
|
||||
|
||||
config["retry"] = 5;
|
||||
config["fast_open"] = true;
|
||||
config["lazy_start"] = true;
|
||||
config["obfs"] = obfsPassword;
|
||||
config["up_mbps"] = uploadMbps;
|
||||
config["down_mbps"] = downloadMbps;
|
||||
|
||||
if (authPayloadType == hysteria_auth_base64) config["auth"] = authPayload;
|
||||
if (authPayloadType == hysteria_auth_string) config["auth_str"] = authPayload;
|
||||
|
||||
if (hyProtocol == hysteria_protocol_facktcp) config["protocol"] = "faketcp";
|
||||
if (hyProtocol == hysteria_protocol_wechat_video) config["protocol"] = "wechat-video";
|
||||
|
||||
if (!sniGen.isEmpty()) config["server_name"] = sniGen;
|
||||
if (!alpn.isEmpty()) config["alpn"] = alpn;
|
||||
|
||||
if (!caText.trimmed().isEmpty()) {
|
||||
WriteTempFile("hysteria_" + GetRandomString(10) + ".crt", caText.toUtf8());
|
||||
config["ca"] = TempFile;
|
||||
}
|
||||
|
||||
if (allowInsecure) config["insecure"] = true;
|
||||
if (streamReceiveWindow > 0) config["recv_window_conn"] = streamReceiveWindow;
|
||||
if (connectionReceiveWindow > 0) config["recv_window"] = connectionReceiveWindow;
|
||||
if (disableMtuDiscovery) config["disable_mtu_discovery"] = true;
|
||||
config["hop_interval"] = hopInterval;
|
||||
|
||||
//
|
||||
|
||||
result.config_export = QJsonObject2QString(config, false);
|
||||
WriteTempFile("hysteria_" + GetRandomString(10) + ".json", result.config_export.toUtf8());
|
||||
result.arguments = QStringList{"--no-check", "-c", TempFile};
|
||||
|
||||
return result;
|
||||
}
|
||||
ExternalBuildResult e;
|
||||
e.error = "unknown type";
|
||||
return e;
|
||||
}
|
||||
|
||||
ExternalBuildResult CustomBean::BuildExternal(int mapping_port, int socks_port, int external_stat) {
|
||||
|
||||
@@ -182,29 +182,7 @@ namespace NekoGui_fmt {
|
||||
|
||||
QString QUICBean::ToShareLink() {
|
||||
QUrl url;
|
||||
if (proxy_type == proxy_Hysteria) {
|
||||
url.setScheme("hysteria");
|
||||
url.setHost(serverAddress);
|
||||
url.setPort(serverPort);
|
||||
QUrlQuery q;
|
||||
q.addQueryItem("upmbps", Int2String(uploadMbps));
|
||||
q.addQueryItem("downmbps", Int2String(downloadMbps));
|
||||
if (!obfsPassword.isEmpty()) {
|
||||
q.addQueryItem("obfs", "xplus");
|
||||
q.addQueryItem("obfsParam", obfsPassword);
|
||||
}
|
||||
if (authPayloadType == hysteria_auth_string) q.addQueryItem("auth", authPayload);
|
||||
if (hyProtocol == hysteria_protocol_facktcp) q.addQueryItem("protocol", "faketcp");
|
||||
if (hyProtocol == hysteria_protocol_wechat_video) q.addQueryItem("protocol", "wechat-video");
|
||||
if (!hopPort.trimmed().isEmpty()) q.addQueryItem("mport", hopPort);
|
||||
if (allowInsecure) q.addQueryItem("insecure", "1");
|
||||
if (!sni.isEmpty()) q.addQueryItem("peer", sni);
|
||||
if (!alpn.isEmpty()) q.addQueryItem("alpn", alpn);
|
||||
if (connectionReceiveWindow > 0) q.addQueryItem("recv_window", Int2String(connectionReceiveWindow));
|
||||
if (streamReceiveWindow > 0) q.addQueryItem("recv_window_conn", Int2String(streamReceiveWindow));
|
||||
if (!q.isEmpty()) url.setQuery(q);
|
||||
if (!name.isEmpty()) url.setFragment(name);
|
||||
} else if (proxy_type == proxy_TUIC) {
|
||||
if (proxy_type == proxy_TUIC) {
|
||||
url.setScheme("tuic");
|
||||
url.setUserName(uuid);
|
||||
url.setPassword(password);
|
||||
|
||||
@@ -256,37 +256,7 @@ namespace NekoGui_fmt {
|
||||
auto query = QUrlQuery(url.query());
|
||||
if (url.host().isEmpty() || url.port() == -1) return false;
|
||||
|
||||
if (url.scheme() == "hysteria") {
|
||||
// https://hysteria.network/docs/uri-scheme/
|
||||
if (!query.hasQueryItem("upmbps") || !query.hasQueryItem("downmbps")) return false;
|
||||
|
||||
name = url.fragment(QUrl::FullyDecoded);
|
||||
serverAddress = url.host();
|
||||
serverPort = url.port();
|
||||
hopPort = query.queryItemValue("mport");
|
||||
obfsPassword = query.queryItemValue("obfsParam");
|
||||
allowInsecure = QStringList{"1", "true"}.contains(query.queryItemValue("insecure"));
|
||||
uploadMbps = query.queryItemValue("upmbps").toInt();
|
||||
downloadMbps = query.queryItemValue("downmbps").toInt();
|
||||
|
||||
auto protocolStr = (query.hasQueryItem("protocol") ? query.queryItemValue("protocol") : "udp").toLower();
|
||||
if (protocolStr == "faketcp") {
|
||||
hyProtocol = NekoGui_fmt::QUICBean::hysteria_protocol_facktcp;
|
||||
} else if (protocolStr.startsWith("wechat")) {
|
||||
hyProtocol = NekoGui_fmt::QUICBean::hysteria_protocol_wechat_video;
|
||||
}
|
||||
|
||||
if (query.hasQueryItem("auth")) {
|
||||
authPayload = query.queryItemValue("auth");
|
||||
authPayloadType = NekoGui_fmt::QUICBean::hysteria_auth_string;
|
||||
}
|
||||
|
||||
alpn = query.queryItemValue("alpn");
|
||||
sni = FIRST_OR_SECOND(query.queryItemValue("peer"), query.queryItemValue("sni"));
|
||||
|
||||
connectionReceiveWindow = query.queryItemValue("recv_window").toInt();
|
||||
streamReceiveWindow = query.queryItemValue("recv_window_conn").toInt();
|
||||
} else if (url.scheme() == "tuic") {
|
||||
if (url.scheme() == "tuic") {
|
||||
// by daeuniverse
|
||||
// https://github.com/daeuniverse/dae/discussions/182
|
||||
|
||||
|
||||
@@ -5,32 +5,19 @@
|
||||
namespace NekoGui_fmt {
|
||||
class QUICBean : public AbstractBean {
|
||||
public:
|
||||
static constexpr int proxy_Hysteria = 0;
|
||||
// static constexpr int proxy_Hysteria = 0;
|
||||
static constexpr int proxy_TUIC = 1;
|
||||
static constexpr int proxy_Hysteria2 = 3;
|
||||
int proxy_type = proxy_Hysteria;
|
||||
int proxy_type = proxy_Hysteria2;
|
||||
|
||||
bool forceExternal = false;
|
||||
|
||||
// Hysteria 1
|
||||
|
||||
static constexpr int hysteria_protocol_udp = 0;
|
||||
static constexpr int hysteria_protocol_facktcp = 1;
|
||||
static constexpr int hysteria_protocol_wechat_video = 2;
|
||||
int hyProtocol = 0;
|
||||
|
||||
static constexpr int hysteria_auth_none = 0;
|
||||
static constexpr int hysteria_auth_string = 1;
|
||||
static constexpr int hysteria_auth_base64 = 2;
|
||||
int authPayloadType = 0;
|
||||
QString authPayload = "";
|
||||
|
||||
// Hysteria 1&2
|
||||
// Hysteria 2
|
||||
|
||||
QString obfsPassword = "";
|
||||
|
||||
int uploadMbps = 100;
|
||||
int downloadMbps = 100;
|
||||
int uploadMbps = 0;
|
||||
int downloadMbps = 0;
|
||||
|
||||
qint64 streamReceiveWindow = 0;
|
||||
qint64 connectionReceiveWindow = 0;
|
||||
@@ -62,8 +49,7 @@ namespace NekoGui_fmt {
|
||||
|
||||
explicit QUICBean(int _proxy_type) : AbstractBean(0) {
|
||||
proxy_type = _proxy_type;
|
||||
if (proxy_type == proxy_Hysteria || proxy_type == proxy_Hysteria2) {
|
||||
_add(new configItem("authPayload", &authPayload, itemType::string));
|
||||
if (proxy_type == proxy_Hysteria2) {
|
||||
_add(new configItem("obfsPassword", &obfsPassword, itemType::string));
|
||||
_add(new configItem("uploadMbps", &uploadMbps, itemType::integer));
|
||||
_add(new configItem("downloadMbps", &downloadMbps, itemType::integer));
|
||||
@@ -72,14 +58,7 @@ namespace NekoGui_fmt {
|
||||
_add(new configItem("disableMtuDiscovery", &disableMtuDiscovery, itemType::boolean));
|
||||
_add(new configItem("hopInterval", &hopInterval, itemType::integer));
|
||||
_add(new configItem("hopPort", &hopPort, itemType::string));
|
||||
if (proxy_type == proxy_Hysteria) { // hy1
|
||||
_add(new configItem("authPayloadType", &authPayloadType, itemType::integer));
|
||||
_add(new configItem("protocol", &hyProtocol, itemType::integer));
|
||||
} else { // hy2
|
||||
uploadMbps = 0;
|
||||
downloadMbps = 0;
|
||||
_add(new configItem("password", &password, itemType::string));
|
||||
}
|
||||
} else if (proxy_type == proxy_TUIC) {
|
||||
_add(new configItem("uuid", &uuid, itemType::string));
|
||||
_add(new configItem("password", &password, itemType::string));
|
||||
@@ -108,8 +87,6 @@ namespace NekoGui_fmt {
|
||||
return software_core_name;
|
||||
} else if (proxy_type == proxy_TUIC) {
|
||||
return "tuic";
|
||||
} else if (proxy_type == proxy_Hysteria) {
|
||||
return "hysteria";
|
||||
} else {
|
||||
return "hysteria2";
|
||||
}
|
||||
@@ -118,8 +95,6 @@ namespace NekoGui_fmt {
|
||||
QString DisplayType() override {
|
||||
if (proxy_type == proxy_TUIC) {
|
||||
return "TUIC";
|
||||
} else if (proxy_type == proxy_Hysteria) {
|
||||
return "Hysteria1";
|
||||
} else {
|
||||
return "Hysteria2";
|
||||
}
|
||||
|
||||
@@ -122,14 +122,6 @@ namespace NekoGui_sub {
|
||||
if (!ok) return;
|
||||
}
|
||||
|
||||
// Hysteria1
|
||||
if (str.startsWith("hysteria://")) {
|
||||
needFix = false;
|
||||
ent = NekoGui::ProfileManager::NewProxyEntity("hysteria");
|
||||
auto ok = ent->QUICBean()->TryParseLink(str);
|
||||
if (!ok) return;
|
||||
}
|
||||
|
||||
// Hysteria2
|
||||
if (str.startsWith("hysteria2://") || str.startsWith("hy2://")) {
|
||||
needFix = false;
|
||||
@@ -413,37 +405,6 @@ namespace NekoGui_sub {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (type == "hysteria") {
|
||||
auto bean = ent->QUICBean();
|
||||
|
||||
bean->hopPort = Node2QString(proxy["ports"]);
|
||||
|
||||
bean->allowInsecure = Node2Bool(proxy["skip-cert-verify"]);
|
||||
auto alpn = Node2QStringList(proxy["alpn"]);
|
||||
bean->caText = Node2QString(proxy["ca-str"]);
|
||||
if (!alpn.isEmpty()) bean->alpn = alpn[0];
|
||||
bean->sni = Node2QString(proxy["sni"]);
|
||||
|
||||
auto auth_str = FIRST_OR_SECOND(Node2QString(proxy["auth_str"]), Node2QString(proxy["auth-str"]));
|
||||
auto auth = Node2QString(proxy["auth"]);
|
||||
if (!auth_str.isEmpty()) {
|
||||
bean->authPayloadType = NekoGui_fmt::QUICBean::hysteria_auth_string;
|
||||
bean->authPayload = auth_str;
|
||||
}
|
||||
if (!auth.isEmpty()) {
|
||||
bean->authPayloadType = NekoGui_fmt::QUICBean::hysteria_auth_base64;
|
||||
bean->authPayload = auth;
|
||||
}
|
||||
bean->obfsPassword = Node2QString(proxy["obfs"]);
|
||||
|
||||
if (Node2Bool(proxy["disable_mtu_discovery"]) || Node2Bool(proxy["disable-mtu-discovery"])) bean->disableMtuDiscovery = true;
|
||||
bean->streamReceiveWindow = Node2Int(proxy["recv-window"]);
|
||||
bean->connectionReceiveWindow = Node2Int(proxy["recv-window-conn"]);
|
||||
|
||||
auto upMbps = Node2QString(proxy["up"]).split(" ")[0].toInt();
|
||||
auto downMbps = Node2QString(proxy["down"]).split(" ")[0].toInt();
|
||||
if (upMbps > 0) bean->uploadMbps = upMbps;
|
||||
if (downMbps > 0) bean->downloadMbps = downMbps;
|
||||
} else if (type == "hysteria2") {
|
||||
auto bean = ent->QUICBean();
|
||||
|
||||
|
||||
@@ -857,14 +857,6 @@ This needs to be run NekoBox with administrator privileges.</source>
|
||||
<source>Certificate</source>
|
||||
<translation type="unfinished">گواهی</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Auth Type</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Protocol</source>
|
||||
<translation type="unfinished">پروتکل</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Download (Mbps)</source>
|
||||
<translation type="unfinished">دانلود (مگابیت بر ثانیه)</translation>
|
||||
@@ -897,10 +889,6 @@ This needs to be run NekoBox with administrator privileges.</source>
|
||||
<source>SNI</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Auth Payload</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable SNI</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
||||
@@ -856,14 +856,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun</translation>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditQUIC</name>
|
||||
<message>
|
||||
<source>Auth Type</source>
|
||||
<translation>Тип авторизации</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Protocol</source>
|
||||
<translation>Протокол</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Download (Mbps)</source>
|
||||
<translation>Скорость приема (Mbps)</translation>
|
||||
@@ -900,10 +892,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun</translation>
|
||||
<source>SNI</source>
|
||||
<translation>SNI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Auth Payload</source>
|
||||
<translation>Полезная нагрузка в режиме авторизации</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disable SNI</source>
|
||||
<translation>Отключить SNI</translation>
|
||||
|
||||
@@ -861,14 +861,6 @@ This needs to be run NekoBox with administrator privileges.</source>
|
||||
<source>Certificate</source>
|
||||
<translation>证书</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Auth Type</source>
|
||||
<translation>认证类型</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Protocol</source>
|
||||
<translation>协议</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Download (Mbps)</source>
|
||||
<translation>下载速度 (Mbps)</translation>
|
||||
@@ -901,10 +893,6 @@ This needs to be run NekoBox with administrator privileges.</source>
|
||||
<source>SNI</source>
|
||||
<translation>SNI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Auth Payload</source>
|
||||
<translation>认证有效载荷</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Generate UUID</source>
|
||||
<translation>生成 UUID</translation>
|
||||
@@ -1222,10 +1210,6 @@ This needs to be run NekoBox with administrator privileges.</source>
|
||||
<source>Testing</source>
|
||||
<translation>正在测试</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Http inbound is not enabled, can't set system proxy.</source>
|
||||
<translation>HTTP 入站未启用,无法设置系统代理。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Update</source>
|
||||
<translation>更新</translation>
|
||||
@@ -1296,10 +1280,6 @@ End: %2</source>
|
||||
<source>Remove Unavailable</source>
|
||||
<translation>删除不可用的配置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Settings</source>
|
||||
<translation>设置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>New profile</source>
|
||||
<translation>手动输入配置</translation>
|
||||
|
||||
@@ -159,7 +159,6 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent)
|
||||
//
|
||||
CACHE.extraCore = QString2QJsonObject(NekoGui::dataStore->extraCore->core_map);
|
||||
if (!CACHE.extraCore.contains("naive")) CACHE.extraCore.insert("naive", "");
|
||||
if (!CACHE.extraCore.contains("hysteria")) CACHE.extraCore.insert("hysteria", "");
|
||||
if (!CACHE.extraCore.contains("hysteria2")) CACHE.extraCore.insert("hysteria2", "");
|
||||
if (!CACHE.extraCore.contains("tuic")) CACHE.extraCore.insert("tuic", "");
|
||||
//
|
||||
|
||||
@@ -114,7 +114,6 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId,
|
||||
LOAD_TYPE("vmess")
|
||||
LOAD_TYPE("vless")
|
||||
LOAD_TYPE("naive")
|
||||
LOAD_TYPE("hysteria")
|
||||
LOAD_TYPE("hysteria2")
|
||||
LOAD_TYPE("tuic")
|
||||
ui->type->addItem(tr("Custom (%1 outbound)").arg(software_core_name), "internal");
|
||||
@@ -172,7 +171,7 @@ void DialogEditProfile::typeSelected(const QString &newType) {
|
||||
auto _innerWidget = new EditNaive(this);
|
||||
innerWidget = _innerWidget;
|
||||
innerEditor = _innerWidget;
|
||||
} else if (type == "hysteria" || type == "hysteria2" || type == "tuic") {
|
||||
} else if (type == "hysteria2" || type == "tuic") {
|
||||
auto _innerWidget = new EditQUIC(this);
|
||||
innerWidget = _innerWidget;
|
||||
innerEditor = _innerWidget;
|
||||
|
||||
@@ -40,7 +40,6 @@ void EditCustom::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
// load known core
|
||||
auto core_map = QString2QJsonObject(NekoGui::dataStore->extraCore->core_map);
|
||||
for (const auto &key: core_map.keys()) {
|
||||
if (key == "naive" || key == "hysteria") continue;
|
||||
ui->core->addItem(key);
|
||||
}
|
||||
if (preset_core == "internal") {
|
||||
|
||||
@@ -25,13 +25,10 @@ void EditQUIC::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
P_LOAD_INT(downloadMbps);
|
||||
P_LOAD_BOOL(disableMtuDiscovery)
|
||||
P_LOAD_STRING(obfsPassword);
|
||||
P_LOAD_STRING(authPayload);
|
||||
P_LOAD_INT(streamReceiveWindow);
|
||||
P_LOAD_INT(connectionReceiveWindow);
|
||||
|
||||
P_LOAD_BOOL(forceExternal);
|
||||
P_LOAD_COMBO_INT(hyProtocol);
|
||||
P_LOAD_COMBO_INT(authPayloadType);
|
||||
P_LOAD_STRING(uuid);
|
||||
P_LOAD_STRING(password);
|
||||
|
||||
@@ -48,7 +45,7 @@ void EditQUIC::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
P_LOAD_BOOL(allowInsecure);
|
||||
P_LOAD_BOOL(disableSni);
|
||||
|
||||
if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria || bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria2) {
|
||||
if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria2) {
|
||||
ui->uuid->hide();
|
||||
ui->uuid_l->hide();
|
||||
ui->uuidgen->hide();
|
||||
@@ -61,18 +58,6 @@ void EditQUIC::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
ui->heartbeat_l->hide();
|
||||
ui->uos->hide();
|
||||
|
||||
if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_Hysteria) { // hy1
|
||||
ui->password->hide();
|
||||
ui->password_l->hide();
|
||||
} else { // hy2
|
||||
ui->hyProtocol->hide();
|
||||
ui->hyProtocol_l->hide();
|
||||
ui->hyProtocol->hide();
|
||||
ui->hyProtocol_l->hide();
|
||||
ui->authPayload->hide();
|
||||
ui->authPayload_l->hide();
|
||||
ui->authPayloadType->hide();
|
||||
ui->authPayloadType_l->hide();
|
||||
ui->alpn->hide();
|
||||
ui->alpn_l->hide();
|
||||
ui->TLS->removeItem(ui->alpn_sp);
|
||||
@@ -81,7 +66,6 @@ void EditQUIC::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
ui->connectionReceiveWindow_l->hide();
|
||||
ui->streamReceiveWindow->hide();
|
||||
ui->streamReceiveWindow_l->hide();
|
||||
}
|
||||
} else if (bean->proxy_type == NekoGui_fmt::QUICBean::proxy_TUIC) {
|
||||
ui->hopPort->hide();
|
||||
ui->hopPort_l->hide();
|
||||
@@ -91,15 +75,9 @@ void EditQUIC::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
ui->uploadMbps_l->hide();
|
||||
ui->downloadMbps->hide();
|
||||
ui->downloadMbps_l->hide();
|
||||
ui->hyProtocol->hide();
|
||||
ui->hyProtocol_l->hide();
|
||||
ui->disableMtuDiscovery->hide();
|
||||
ui->obfsPassword->hide();
|
||||
ui->obfsPassword_l->hide();
|
||||
ui->authPayload->hide();
|
||||
ui->authPayload_l->hide();
|
||||
ui->authPayloadType->hide();
|
||||
ui->authPayloadType_l->hide();
|
||||
ui->streamReceiveWindow->hide();
|
||||
ui->streamReceiveWindow_l->hide();
|
||||
ui->connectionReceiveWindow->hide();
|
||||
@@ -113,16 +91,13 @@ bool EditQUIC::onEnd() {
|
||||
|
||||
P_SAVE_BOOL(forceExternal);
|
||||
|
||||
// Hysteria
|
||||
// Hysteria 2
|
||||
P_SAVE_STRING(hopPort);
|
||||
P_SAVE_INT(hopInterval);
|
||||
P_SAVE_INT(uploadMbps);
|
||||
P_SAVE_INT(downloadMbps);
|
||||
P_SAVE_COMBO_INT(hyProtocol);
|
||||
P_SAVE_BOOL(disableMtuDiscovery)
|
||||
P_SAVE_STRING(obfsPassword);
|
||||
P_SAVE_COMBO_INT(authPayloadType);
|
||||
P_SAVE_STRING(authPayload);
|
||||
P_SAVE_INT(streamReceiveWindow);
|
||||
P_SAVE_INT(connectionReceiveWindow);
|
||||
|
||||
|
||||
@@ -16,6 +16,48 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="upBox">
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="downloadMbpsLay">
|
||||
<item>
|
||||
<widget class="QLabel" name="downloadMbps_l">
|
||||
<property name="text">
|
||||
<string>Download (Mbps)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MyLineEdit" name="downloadMbps"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="hopPortLay">
|
||||
<item>
|
||||
<widget class="QLabel" name="hopPort_l">
|
||||
<property name="text">
|
||||
<string>Hop Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MyLineEdit" name="hopPort"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="hopIntervalLay">
|
||||
<item>
|
||||
<widget class="QLabel" name="hopInterval_l">
|
||||
<property name="text">
|
||||
<string>Hop Interval (s)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MyLineEdit" name="hopInterval"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<layout class="QHBoxLayout" name="heartbeatLay">
|
||||
<item>
|
||||
@@ -37,20 +79,27 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="hopPortLay">
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="uploadMbpsLay">
|
||||
<item>
|
||||
<widget class="QLabel" name="hopPort_l">
|
||||
<widget class="QLabel" name="uploadMbps_l">
|
||||
<property name="text">
|
||||
<string>Hop Port</string>
|
||||
<string>Upload (Mbps)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MyLineEdit" name="hopPort"/>
|
||||
<widget class="MyLineEdit" name="uploadMbps"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="zeroRttHandshake">
|
||||
<property name="text">
|
||||
<string>Zero Rtt Handshake</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="congestionControlLay">
|
||||
<item>
|
||||
@@ -81,48 +130,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="downloadMbpsLay">
|
||||
<item>
|
||||
<widget class="QLabel" name="downloadMbps_l">
|
||||
<property name="text">
|
||||
<string>Download (Mbps)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MyLineEdit" name="downloadMbps"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="hopIntervalLay">
|
||||
<item>
|
||||
<widget class="QLabel" name="hopInterval_l">
|
||||
<property name="text">
|
||||
<string>Hop Interval (s)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MyLineEdit" name="hopInterval"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="uploadMbpsLay">
|
||||
<item>
|
||||
<widget class="QLabel" name="uploadMbps_l">
|
||||
<property name="text">
|
||||
<string>Upload (Mbps)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="MyLineEdit" name="uploadMbps"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="udpRelayModeLay">
|
||||
<item>
|
||||
@@ -148,14 +155,18 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="zeroRttHandshake">
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="forceExternal">
|
||||
<property name="text">
|
||||
<string>Zero Rtt Handshake</string>
|
||||
<string>Force use external core</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="uos">
|
||||
<property name="toolTip">
|
||||
<string notr="true">Requires sing-box server</string>
|
||||
@@ -165,52 +176,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="forceExternal">
|
||||
<property name="text">
|
||||
<string>Force use external core</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="obfuscation">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="obfsPassword_l">
|
||||
<property name="text">
|
||||
<string>Obfs Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="hyProtocol_l">
|
||||
<property name="text">
|
||||
<string>Protocol</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QComboBox" name="hyProtocol">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">QUIC</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">FakeTCP</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">wechat-video</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="disableMtuDiscovery">
|
||||
<property name="sizePolicy">
|
||||
@@ -226,43 +191,40 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="obfuscation">
|
||||
<item row="0" column="1">
|
||||
<widget class="MyLineEdit" name="obfsPassword"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="obfsPassword_l">
|
||||
<property name="text">
|
||||
<string>Obfs Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="authentication">
|
||||
<item row="2" column="1">
|
||||
<widget class="MyLineEdit" name="uuid"/>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="uuidgen">
|
||||
<property name="text">
|
||||
<string>Generate UUID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="authPayloadType_l">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<widget class="QLabel" name="uuid_l">
|
||||
<property name="text">
|
||||
<string>Auth Type</string>
|
||||
<string notr="true">UUID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="MyLineEdit" name="uuid"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="authPayload_l">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auth Payload</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="password_l">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
@@ -275,44 +237,8 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="uuid_l">
|
||||
<property name="text">
|
||||
<string notr="true">UUID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="uuidgen">
|
||||
<property name="text">
|
||||
<string>Generate UUID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="MyLineEdit" name="password"/>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="MyLineEdit" name="authPayload"/>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="authPayloadType">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">NONE</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">STRING</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">BASE64</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="MyLineEdit" name="password"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
@@ -428,11 +354,8 @@
|
||||
<tabstop>zeroRttHandshake</tabstop>
|
||||
<tabstop>forceExternal</tabstop>
|
||||
<tabstop>uos</tabstop>
|
||||
<tabstop>hyProtocol</tabstop>
|
||||
<tabstop>disableMtuDiscovery</tabstop>
|
||||
<tabstop>obfsPassword</tabstop>
|
||||
<tabstop>authPayloadType</tabstop>
|
||||
<tabstop>authPayload</tabstop>
|
||||
<tabstop>uuid</tabstop>
|
||||
<tabstop>uuidgen</tabstop>
|
||||
<tabstop>password</tabstop>
|
||||
|
||||
Reference in New Issue
Block a user