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