mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
gui: VLESS Flow
This commit is contained in:
@@ -125,6 +125,7 @@ namespace NekoRay::fmt {
|
|||||||
QJsonObject settings;
|
QJsonObject settings;
|
||||||
if (proxy_type == proxy_VLESS) {
|
if (proxy_type == proxy_VLESS) {
|
||||||
outbound["uuid"] = password.trimmed();
|
outbound["uuid"] = password.trimmed();
|
||||||
|
outbound["flow"] = flow;
|
||||||
} else {
|
} else {
|
||||||
outbound["password"] = password;
|
outbound["password"] = password;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ namespace NekoRay::fmt {
|
|||||||
|
|
||||||
if (!stream->sni.isEmpty()) query.addQueryItem("sni", stream->sni);
|
if (!stream->sni.isEmpty()) query.addQueryItem("sni", stream->sni);
|
||||||
if (stream->allow_insecure) query.addQueryItem("allowInsecure", "1");
|
if (stream->allow_insecure) query.addQueryItem("allowInsecure", "1");
|
||||||
|
if (IS_NEKO_BOX && !stream->utlsFingerprint.isEmpty()) query.addQueryItem("fp", stream->utlsFingerprint);
|
||||||
|
|
||||||
if (security == "reality") {
|
if (security == "reality") {
|
||||||
query.addQueryItem("pbk", stream->reality_pbk);
|
query.addQueryItem("pbk", stream->reality_pbk);
|
||||||
@@ -60,6 +61,13 @@ namespace NekoRay::fmt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// protocol
|
||||||
|
if (proxy_type == proxy_VLESS) {
|
||||||
|
if (!flow.isEmpty()) {
|
||||||
|
query.addQueryItem("flow", flow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
url.setQuery(query);
|
url.setQuery(query);
|
||||||
return url.toString(QUrl::FullyEncoded);
|
return url.toString(QUrl::FullyEncoded);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ namespace NekoRay::fmt {
|
|||||||
password = url.userName();
|
password = url.userName();
|
||||||
if (serverPort == -1) serverPort = 443;
|
if (serverPort == -1) serverPort = 443;
|
||||||
|
|
||||||
|
// security
|
||||||
stream->network = GetQueryValue(query, "type", "tcp");
|
stream->network = GetQueryValue(query, "type", "tcp");
|
||||||
stream->security = GetQueryValue(query, "security", "tls").replace("reality", "tls");
|
stream->security = GetQueryValue(query, "security", "tls").replace("reality", "tls");
|
||||||
auto sni1 = GetQueryValue(query, "sni");
|
auto sni1 = GetQueryValue(query, "sni");
|
||||||
@@ -64,7 +65,9 @@ namespace NekoRay::fmt {
|
|||||||
if (!query.queryItemValue("allowInsecure").isEmpty()) stream->allow_insecure = true;
|
if (!query.queryItemValue("allowInsecure").isEmpty()) stream->allow_insecure = true;
|
||||||
stream->reality_pbk = GetQueryValue(query, "pbk", "");
|
stream->reality_pbk = GetQueryValue(query, "pbk", "");
|
||||||
stream->reality_sid = GetQueryValue(query, "sid", "");
|
stream->reality_sid = GetQueryValue(query, "sid", "");
|
||||||
|
if (IS_NEKO_BOX) stream->utlsFingerprint = GetQueryValue(query, "fp", "");
|
||||||
|
|
||||||
|
// type
|
||||||
if (stream->network == "ws") {
|
if (stream->network == "ws") {
|
||||||
stream->path = GetQueryValue(query, "path", "");
|
stream->path = GetQueryValue(query, "path", "");
|
||||||
stream->host = GetQueryValue(query, "host", "");
|
stream->host = GetQueryValue(query, "host", "");
|
||||||
@@ -80,6 +83,11 @@ namespace NekoRay::fmt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// protocol
|
||||||
|
if (proxy_type == proxy_VLESS) {
|
||||||
|
flow = GetQueryValue(query, "flow", "");
|
||||||
|
}
|
||||||
|
|
||||||
return !password.isEmpty();
|
return !password.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ namespace NekoRay::fmt {
|
|||||||
int proxy_type = proxy_Trojan;
|
int proxy_type = proxy_Trojan;
|
||||||
|
|
||||||
QString password = "";
|
QString password = "";
|
||||||
|
QString flow = "";
|
||||||
|
|
||||||
QSharedPointer<V2rayStreamSettings> stream = QSharedPointer<V2rayStreamSettings>(new V2rayStreamSettings());
|
QSharedPointer<V2rayStreamSettings> stream = QSharedPointer<V2rayStreamSettings>(new V2rayStreamSettings());
|
||||||
QString custom = "";
|
QString custom = "";
|
||||||
@@ -18,6 +19,7 @@ namespace NekoRay::fmt {
|
|||||||
explicit TrojanVLESSBean(int _proxy_type) : AbstractBean(0) {
|
explicit TrojanVLESSBean(int _proxy_type) : AbstractBean(0) {
|
||||||
proxy_type = _proxy_type;
|
proxy_type = _proxy_type;
|
||||||
_add(new configItem("pass", &password, itemType::string));
|
_add(new configItem("pass", &password, itemType::string));
|
||||||
|
_add(new configItem("flow", &flow, itemType::string));
|
||||||
_add(new configItem("stream", dynamic_cast<JsonStore *>(stream.get()), itemType::jsonStore));
|
_add(new configItem("stream", dynamic_cast<JsonStore *>(stream.get()), itemType::jsonStore));
|
||||||
_add(new configItem("custom", &custom, itemType::string));
|
_add(new configItem("custom", &custom, itemType::string));
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,12 +14,20 @@ EditTrojanVLESS::~EditTrojanVLESS() {
|
|||||||
void EditTrojanVLESS::onStart(QSharedPointer<NekoRay::ProxyEntity> _ent) {
|
void EditTrojanVLESS::onStart(QSharedPointer<NekoRay::ProxyEntity> _ent) {
|
||||||
this->ent = _ent;
|
this->ent = _ent;
|
||||||
auto bean = this->ent->TrojanVLESSBean();
|
auto bean = this->ent->TrojanVLESSBean();
|
||||||
if (bean->proxy_type == NekoRay::fmt::TrojanVLESSBean::proxy_VLESS) ui->label->setText("UUID");
|
if (bean->proxy_type == NekoRay::fmt::TrojanVLESSBean::proxy_VLESS) {
|
||||||
|
ui->label->setText("UUID");
|
||||||
|
}
|
||||||
|
if (!IS_NEKO_BOX || bean->proxy_type != NekoRay::fmt::TrojanVLESSBean::proxy_VLESS) {
|
||||||
|
ui->flow->hide();
|
||||||
|
ui->flow_l->hide();
|
||||||
|
}
|
||||||
ui->password->setText(bean->password);
|
ui->password->setText(bean->password);
|
||||||
|
ui->flow->setCurrentText(bean->flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EditTrojanVLESS::onEnd() {
|
bool EditTrojanVLESS::onEnd() {
|
||||||
auto bean = this->ent->TrojanVLESSBean();
|
auto bean = this->ent->TrojanVLESSBean();
|
||||||
bean->password = ui->password->text();
|
bean->password = ui->password->text();
|
||||||
|
bean->flow = ui->flow->currentText();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="MyLineEdit" name="password"/>
|
||||||
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -21,8 +24,26 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="1" column="0">
|
||||||
<widget class="MyLineEdit" name="password"/>
|
<widget class="QLabel" name="flow_l">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">Flow</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="flow">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">xtls-rprx-vision</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Reference in New Issue
Block a user