From 61918f736b44603694d9e47c4b641bd76018d6da Mon Sep 17 00:00:00 2001 From: Hingbong Lo Date: Wed, 26 Oct 2022 20:48:01 +0800 Subject: [PATCH] use '::' instead of '0.0.0.0' to listen for ipv6 trafic (#102) --- ui/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index 81d4977..4fa2107 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -262,7 +262,7 @@ MainWindow::MainWindow(QWidget *parent) connect(ui->menu_program, &QMenu::aboutToShow, this, [=]() { ui->actionRemember_last_proxy->setChecked(NekoRay::dataStore->remember_enable); ui->actionStart_with_system->setChecked(GetProcessAutoRunSelf()); - ui->actionAllow_LAN->setChecked(NekoRay::dataStore->inbound_address == "0.0.0.0"); + ui->actionAllow_LAN->setChecked(QStringList{"::", "0.0.0.0"}.contains(NekoRay::dataStore->inbound_address)); // active server for (const auto &old: ui->menuActive_Server->actions()) { ui->menuActive_Server->removeAction(old); @@ -325,7 +325,7 @@ MainWindow::MainWindow(QWidget *parent) SetProcessAutoRunSelf(checked); }); connect(ui->actionAllow_LAN, &QAction::triggered, this, [=](bool checked) { - NekoRay::dataStore->inbound_address = checked ? "0.0.0.0" : "127.0.0.1"; + NekoRay::dataStore->inbound_address = checked ? "::" : "127.0.0.1"; dialog_message("", "UpdateDataStore"); }); //