modify the port detection range to prevent the use of system ports (#3587)

Co-authored-by: Ahao <108321411+xuanyuan0408@users.noreply.github.com>
This commit is contained in:
Ahao
2025-05-25 17:05:08 +08:00
committed by GitHub
parent 10479b0936
commit d3dbc11b1b
2 changed files with 11 additions and 10 deletions

View File

@@ -77,6 +77,7 @@
- 优化了保存机制,使用平滑函数,防止客户端卡死
- 优化端口设置退出和保存机制
- 强制为 Mihomo 配置补全并覆盖 external-controller-cors 字段,默认不允许跨域和仅本地请求,提升 cors 安全性,升级配置时自动覆盖
- 修改 端口检测范围 1111-65536
#### 移除了:
- 窗口状态管理器

View File

@@ -71,8 +71,8 @@ export const useClashInfo = () => {
if (patch["redir-port"]) {
const port = patch["redir-port"];
if (port < 1000) {
throw new Error("The port should not < 1000");
if (port < 1111) {
throw new Error("The port should not < 1111");
}
if (port > 65536) {
throw new Error("The port should not > 65536");
@@ -81,8 +81,8 @@ export const useClashInfo = () => {
if (patch["tproxy-port"]) {
const port = patch["tproxy-port"];
if (port < 1000) {
throw new Error("The port should not < 1000");
if (port < 1111) {
throw new Error("The port should not < 1111");
}
if (port > 65536) {
throw new Error("The port should not > 65536");
@@ -91,8 +91,8 @@ export const useClashInfo = () => {
if (patch["mixed-port"]) {
const port = patch["mixed-port"];
if (port < 1000) {
throw new Error("The port should not < 1000");
if (port < 1111) {
throw new Error("The port should not < 1111");
}
if (port > 65536) {
throw new Error("The port should not > 65536");
@@ -101,8 +101,8 @@ export const useClashInfo = () => {
if (patch["socks-port"]) {
const port = patch["socks-port"];
if (port < 1000) {
throw new Error("The port should not < 1000");
if (port < 1111) {
throw new Error("The port should not < 1111");
}
if (port > 65536) {
throw new Error("The port should not > 65536");
@@ -111,8 +111,8 @@ export const useClashInfo = () => {
if (patch["port"]) {
const port = patch["port"];
if (port < 1000) {
throw new Error("The port should not < 1000");
if (port < 1111) {
throw new Error("The port should not < 1111");
}
if (port > 65536) {
throw new Error("The port should not > 65536");