From b389dc226ce4fe5f10c5d5ca53254aee5882da48 Mon Sep 17 00:00:00 2001 From: Charlie Qiu Date: Sun, 2 Oct 2016 01:24:38 +0800 Subject: [PATCH] Call webServer startWithOptions instead of startWithPort MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 建议使用 webServer.startWithOptions(["BindToLocalhost":true,"Port":xxxx]) 来避免提示允许监听端口 --- ShadowsocksX-NG/ProxyConfHelper.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShadowsocksX-NG/ProxyConfHelper.m b/ShadowsocksX-NG/ProxyConfHelper.m index 9c57b61..c716e93 100644 --- a/ShadowsocksX-NG/ProxyConfHelper.m +++ b/ShadowsocksX-NG/ProxyConfHelper.m @@ -176,7 +176,7 @@ GCDWebServer *webServer =nil; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString * address = [defaults stringForKey:@"PacServer.ListenAddress"]; int port = (short)[defaults integerForKey:@"PacServer.ListenPort"]; - [webServer startWithPort:port bonjourName:@"webserver"]; + [webServer startWithOptions:@{@"BindToLocalhost":@YES, @"Port":@(port)} error:nil]; return [NSString stringWithFormat:@"%@%@:%d%@",@"http://",address,port,routerPath]; }