use /proxy.pac

This commit is contained in:
Y. T. Chung
2015-07-04 02:40:15 +08:00
parent 357f42cc5d
commit 9b0375eb64
2 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
// Generated by gfwlist2pac
// https://github.com/clowwindy/gfwlist2pac
var proxy = "PROXY 127.0.0.1:1080";
var proxy = "SOCKS5 127.0.0.1:1080";
var domains = {
"4shared.com": 1,

View File

@@ -210,12 +210,12 @@ fn main() {
server.listen(move|req: Request, mut res: Response| {
match req.uri {
AbsolutePath(ref path) => match (&req.method, &path[..]) {
(&Get, "/") => {
(&Get, "/proxy.pac") => {
if let Err(err) = res.send(&content) {
error!("Error occurs while sending PAC file: {:?}", err);
}
},
(_, "/") => {
(_, "/proxy.pac") => {
*res.status_mut() = hyper::status::StatusCode::MethodNotAllowed;
},
_ => {