fix up firewall permission request

This commit is contained in:
qinyuhang
2016-09-09 11:05:40 +08:00
parent ca38c9a2a2
commit 28961a39fa
+7 -1
View File
@@ -200,7 +200,13 @@ 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"];
NSMutableDictionary* options = [NSMutableDictionary dictionary];
[options setObject:[NSNumber numberWithInteger:port] forKey:GCDWebServerOption_Port];
[options setObject:@YES forKey:@"BindToLocalhost"];
[webServer startWithOptions:options error:NULL];
// [webServer startWithPort:port bonjourName:@"webserver"];
return [NSString stringWithFormat:@"%@%@:%d%@",@"http://",address,port,routerPath];
}