mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-18 20:50:09 +08:00
fix hystteria2 port hopping
This commit is contained in:
parent
ce5163c52b
commit
fe660e04ae
@ -144,7 +144,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="port_range">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Comma seperated ranges: 100-200,500-600</p></body></html></string>
|
||||
<string><html><head/><body><p>Comma seperated ranges: 100:200,500:600</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -173,6 +173,9 @@
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="port_range_l">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Comma seperated ranges: 100:200,500:600</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Port range</string>
|
||||
</property>
|
||||
|
||||
@ -260,18 +260,18 @@ For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mod
|
||||
<source>Proxy Format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Http</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Socks</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>http</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>socks</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DialogEditGroup</name>
|
||||
@ -946,10 +946,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun</source>
|
||||
<source>UDP Relay Mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><html><head/><body><p>Comma seperated ranges: 100-200,500-600</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Port range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@ -962,6 +958,10 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun</source>
|
||||
<source><html><head/><body><p>100ms<br/>1s</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><html><head/><body><p>Comma seperated ranges: 100:200,500:600</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditSSH</name>
|
||||
|
||||
@ -269,18 +269,18 @@ For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mod
|
||||
<source>Proxy Format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Http</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Socks</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>http</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>socks</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DialogEditGroup</name>
|
||||
@ -960,10 +960,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun</translation>
|
||||
<source>UDP Relay Mode</source>
|
||||
<translation>Режим ретрансляции UDP</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><html><head/><body><p>Comma seperated ranges: 100-200,500-600</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Port range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@ -976,6 +972,10 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun</translation>
|
||||
<source><html><head/><body><p>100ms<br/>1s</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><html><head/><body><p>Comma seperated ranges: 100:200,500:600</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditSSH</name>
|
||||
|
||||
@ -261,18 +261,18 @@ For NekoBox, this rewrites the underlying(localhost) DNS in Tun Mode, normal mod
|
||||
<source>Proxy Format</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Http</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Socks</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Language</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>http</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>socks</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DialogEditGroup</name>
|
||||
@ -953,10 +953,6 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun</translation>
|
||||
<source>Disable SNI</source>
|
||||
<translation>不发送服务器名称指示</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><html><head/><body><p>Comma seperated ranges: 100-200,500-600</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Port range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@ -969,6 +965,10 @@ https://matsuridayo.github.io/n-configuration/#vpn-tun</translation>
|
||||
<source><html><head/><body><p>100ms<br/>1s</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><html><head/><body><p>Comma seperated ranges: 100:200,500:600</p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditSSH</name>
|
||||
|
||||
@ -244,13 +244,8 @@ namespace NekoGui_fmt {
|
||||
if (!serverPorts.empty())
|
||||
{
|
||||
outbound.remove("server_port");
|
||||
QStringList portRanges;
|
||||
for (auto range : serverPorts)
|
||||
{
|
||||
portRanges.append(range.replace("-", ":"));
|
||||
}
|
||||
outbound["server_ports"] = QListStr2QJsonArray(portRanges);
|
||||
outbound["hop_interval"] = hop_interval;
|
||||
outbound["server_ports"] = QListStr2QJsonArray(serverPorts);
|
||||
if (!hop_interval.isEmpty()) outbound["hop_interval"] = hop_interval;
|
||||
}
|
||||
|
||||
if (!obfsPassword.isEmpty()) {
|
||||
|
||||
@ -233,10 +233,18 @@ namespace NekoGui_fmt {
|
||||
}
|
||||
if (allowInsecure) q.addQueryItem("insecure", "1");
|
||||
if (!sni.isEmpty()) q.addQueryItem("sni", sni);
|
||||
if (!serverPorts.empty())
|
||||
{
|
||||
QStringList portList;
|
||||
for (const auto& range : serverPorts)
|
||||
{
|
||||
portList.append(range.split(":"));
|
||||
}
|
||||
q.addQueryItem("server_ports", portList.join("-"));
|
||||
}
|
||||
if (!hop_interval.isEmpty()) q.addQueryItem("hop_interval", hop_interval);
|
||||
if (!q.isEmpty()) url.setQuery(q);
|
||||
if (!name.isEmpty()) url.setFragment(name);
|
||||
if (!serverPorts.empty()) q.addQueryItem("server_ports", serverPorts.join("-"));
|
||||
if (!hop_interval.isEmpty()) q.addQueryItem("hop_interval", hop_interval);
|
||||
}
|
||||
return url.toString(QUrl::FullyEncoded);
|
||||
}
|
||||
|
||||
@ -324,7 +324,12 @@ namespace NekoGui_fmt {
|
||||
}
|
||||
if (query.hasQueryItem("server_ports"))
|
||||
{
|
||||
serverPorts = query.queryItemValue("server_ports").split("-");
|
||||
auto portList = query.queryItemValue("server_ports").split("-");
|
||||
for (int i=0;i<portList.size();i+=2)
|
||||
{
|
||||
if (i+1 >= portList.size()) break;
|
||||
serverPorts += portList[i]+":"+portList[i+1];
|
||||
}
|
||||
}
|
||||
hop_interval = query.queryItemValue("hop_interval");
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user