mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 13:04:37 +03:00
fix: port bug
This commit is contained in:
@@ -147,7 +147,7 @@ namespace NekoRay {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// socks-in
|
// socks-in
|
||||||
if (InRange(dataStore->inbound_socks_port, 0, 65535) && !status->forTest) {
|
if (InRange(dataStore->inbound_socks_port, 1, 65535) && !status->forTest) {
|
||||||
QJsonObject socksInbound;
|
QJsonObject socksInbound;
|
||||||
socksInbound["tag"] = "socks-in";
|
socksInbound["tag"] = "socks-in";
|
||||||
socksInbound["protocol"] = "socks";
|
socksInbound["protocol"] = "socks";
|
||||||
@@ -163,7 +163,7 @@ namespace NekoRay {
|
|||||||
status->inbounds += socksInbound;
|
status->inbounds += socksInbound;
|
||||||
}
|
}
|
||||||
// http-in
|
// http-in
|
||||||
if (InRange(dataStore->inbound_http_port, 0, 65535) && !status->forTest) {
|
if (InRange(dataStore->inbound_http_port, 1, 65535) && !status->forTest) {
|
||||||
QJsonObject socksInbound;
|
QJsonObject socksInbound;
|
||||||
socksInbound["tag"] = "http-in";
|
socksInbound["tag"] = "http-in";
|
||||||
socksInbound["protocol"] = "http";
|
socksInbound["protocol"] = "http";
|
||||||
@@ -456,12 +456,12 @@ namespace NekoRay {
|
|||||||
if (thisExternalStat > 0) {
|
if (thisExternalStat > 0) {
|
||||||
if (ent->type == "custom") {
|
if (ent->type == "custom") {
|
||||||
auto bean = ent->CustomBean();
|
auto bean = ent->CustomBean();
|
||||||
if (InRange(bean->mapping_port, 0, 65535)) {
|
if (InRange(bean->mapping_port, 1, 65535)) {
|
||||||
ext_mapping_port = bean->mapping_port;
|
ext_mapping_port = bean->mapping_port;
|
||||||
} else {
|
} else {
|
||||||
ext_mapping_port = MkPort();
|
ext_mapping_port = MkPort();
|
||||||
}
|
}
|
||||||
if (InRange(bean->socks_port, 0, 65535)) {
|
if (InRange(bean->socks_port, 1, 65535)) {
|
||||||
ext_socks_port = bean->socks_port;
|
ext_socks_port = bean->socks_port;
|
||||||
} else {
|
} else {
|
||||||
ext_socks_port = MkPort();
|
ext_socks_port = MkPort();
|
||||||
@@ -642,7 +642,7 @@ namespace NekoRay {
|
|||||||
// Inbounds
|
// Inbounds
|
||||||
|
|
||||||
// mixed-in
|
// mixed-in
|
||||||
if (InRange(dataStore->inbound_socks_port, 0, 65535) && !status->forTest) {
|
if (InRange(dataStore->inbound_socks_port, 1, 65535) && !status->forTest) {
|
||||||
QJsonObject socksInbound;
|
QJsonObject socksInbound;
|
||||||
socksInbound["tag"] = "mixed-in";
|
socksInbound["tag"] = "mixed-in";
|
||||||
socksInbound["type"] = "mixed";
|
socksInbound["type"] = "mixed";
|
||||||
|
|||||||
@@ -588,7 +588,7 @@ void MainWindow::neko_set_spmode(int mode, bool save) {
|
|||||||
if (mode == NekoRay::SystemProxyMode::SYSTEM_PROXY) {
|
if (mode == NekoRay::SystemProxyMode::SYSTEM_PROXY) {
|
||||||
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
|
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
|
||||||
if (mode == NekoRay::SystemProxyMode::SYSTEM_PROXY && !IS_NEKO_BOX &&
|
if (mode == NekoRay::SystemProxyMode::SYSTEM_PROXY && !IS_NEKO_BOX &&
|
||||||
!InRange(NekoRay::dataStore->inbound_http_port, 0, 65535)) {
|
!InRange(NekoRay::dataStore->inbound_http_port, 1, 65535)) {
|
||||||
auto btn = QMessageBox::warning(this, software_name,
|
auto btn = QMessageBox::warning(this, software_name,
|
||||||
tr("Http inbound is not enabled, can't set system proxy."),
|
tr("Http inbound is not enabled, can't set system proxy."),
|
||||||
"OK", tr("Settings"), "", 0, 0);
|
"OK", tr("Settings"), "", 0, 0);
|
||||||
@@ -646,7 +646,7 @@ void MainWindow::refresh_status(const QString &traffic_update) {
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
auto display_http = tr("None");
|
auto display_http = tr("None");
|
||||||
if (InRange(NekoRay::dataStore->inbound_http_port, 0, 65535)) {
|
if (InRange(NekoRay::dataStore->inbound_http_port, 1, 65535)) {
|
||||||
display_http = DisplayAddress(NekoRay::dataStore->inbound_address, NekoRay::dataStore->inbound_http_port);
|
display_http = DisplayAddress(NekoRay::dataStore->inbound_address, NekoRay::dataStore->inbound_http_port);
|
||||||
}
|
}
|
||||||
auto display_socks = DisplayAddress(NekoRay::dataStore->inbound_address, NekoRay::dataStore->inbound_socks_port);
|
auto display_socks = DisplayAddress(NekoRay::dataStore->inbound_address, NekoRay::dataStore->inbound_socks_port);
|
||||||
|
|||||||
Reference in New Issue
Block a user