mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
fix: normalize localhost listen address (#3016)
This commit is contained in:
@@ -144,6 +144,8 @@ export function ProxyPanel({
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const normalizedAddress =
|
||||
addressTrimmed === "localhost" ? "127.0.0.1" : addressTrimmed;
|
||||
const isValidAddress =
|
||||
addressTrimmed === "localhost" ||
|
||||
addressTrimmed === "0.0.0.0" ||
|
||||
@@ -181,7 +183,7 @@ export function ProxyPanel({
|
||||
try {
|
||||
await updateGlobalConfig.mutateAsync({
|
||||
...globalConfig,
|
||||
listenAddress: addressTrimmed,
|
||||
listenAddress: normalizedAddress,
|
||||
listenPort: port,
|
||||
});
|
||||
toast.success(
|
||||
|
||||
Reference in New Issue
Block a user