This commit is contained in:
arm64v8a
2022-09-09 19:32:02 +08:00
parent 719b0aa825
commit dbbd54077b
2 changed files with 3 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
{ {
"type": "tun", "type": "tun",
"interface_name": "nekoray-tun", "interface_name": "nekoray-tun",
"inet4_address": "172.19.0.1/30", "inet4_address": "172.19.0.1/28",
%IPV6_ADDRESS% %IPV6_ADDRESS%
"mtu": %MTU%, "mtu": %MTU%,
"auto_route": true, "auto_route": true,

View File

@@ -1409,7 +1409,7 @@ bool MainWindow::StartVPNProcess() {
auto configFn = ":/nekoray/vpn/sing-box-vpn.json"; auto configFn = ":/nekoray/vpn/sing-box-vpn.json";
if (QFile::exists("vpn/sing-box-vpn.json")) configFn = "vpn/sing-box-vpn.json"; if (QFile::exists("vpn/sing-box-vpn.json")) configFn = "vpn/sing-box-vpn.json";
auto config = ReadFileText(configFn) auto config = ReadFileText(configFn)
.replace("%IPV6_ADDRESS%", NekoRay::dataStore->vpn_ipv6 ? "\"inet6_address\": \"fdfe:dcba:9876::1/128\"," : "") .replace("%IPV6_ADDRESS%", NekoRay::dataStore->vpn_ipv6 ? "\"inet6_address\": \"fdfe:dcba:9876::1/126\"," : "")
.replace("%MTU%", Int2String(NekoRay::dataStore->vpn_mtu)) .replace("%MTU%", Int2String(NekoRay::dataStore->vpn_mtu))
.replace("%STACK%", Preset::SingBox::VpnImplementation[NekoRay::dataStore->vpn_implementation]) .replace("%STACK%", Preset::SingBox::VpnImplementation[NekoRay::dataStore->vpn_implementation])
.replace("%PORT%", Int2String(NekoRay::dataStore->inbound_socks_port)); .replace("%PORT%", Int2String(NekoRay::dataStore->inbound_socks_port));
@@ -1441,7 +1441,7 @@ bool MainWindow::StartVPNProcess() {
runOnNewThread([=] { runOnNewThread([=] {
vpn_pid = 1; //TODO get pid? vpn_pid = 1; //TODO get pid?
WinCommander::runProcessElevated(QApplication::applicationDirPath() + "/sing-box.exe", WinCommander::runProcessElevated(QApplication::applicationDirPath() + "/sing-box.exe",
{"run", "-c", configPath}); // blocking {"--disable-color", "run", "-c", configPath}); // blocking
vpn_pid = 0; vpn_pid = 0;
runOnUiThread([=] { runOnUiThread([=] {
neko_set_spmode(NekoRay::SystemProxyMode::DISABLE); neko_set_spmode(NekoRay::SystemProxyMode::DISABLE);