fix: Allow to set master's public IP

This commit is contained in:
yuanyuanxiang
2025-06-14 02:53:11 +08:00
parent eeb1eb2f0b
commit f4364a4368
7 changed files with 50 additions and 9 deletions

View File

@@ -153,3 +153,15 @@ std::string getPublicIP() {
return std::string(buffer);
}
void splitIpPort(const std::string& input, std::string& ip, std::string& port) {
size_t pos = input.find(':');
if (pos != std::string::npos) {
ip = input.substr(0, pos);
port = input.substr(pos + 1);
}
else {
ip = input;
port = "";
}
}