add adv settings for pac server
add adv settings for pac server address & port handle accident crash on stop pac server
This commit is contained in:
@ -173,14 +173,18 @@ GCDWebServer *webServer =nil;
|
||||
return [GCDWebServerDataResponse responseWithData: originalPACData contentType:@"application/x-ns-proxy-autoconfig"];
|
||||
}
|
||||
];
|
||||
int port = 8090;
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSString * address = [defaults stringForKey:@"PacServer.ListenAddress"];
|
||||
int port = (short)[defaults integerForKey:@"PacServer.ListenPort"];
|
||||
[webServer startWithPort:port bonjourName:@"webserver"];
|
||||
return [NSString stringWithFormat:@"%@%d%@",@"http://127.0.0.1:",port,routerPath];
|
||||
return [NSString stringWithFormat:@"%@%@:%d%@",@"http://",address,port,routerPath];
|
||||
}
|
||||
|
||||
+ (void)stopPACServer {
|
||||
//原版似乎没有处理这个,本来设计计划如果切换到全局模式或者手动模式就关掉webserver 似乎没有这个必要了?
|
||||
[webServer stop];
|
||||
if ([webServer isRunning]) {
|
||||
[webServer stop];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user