From 9b0375eb64fd349cc20cd871248a0f3134d97f4e Mon Sep 17 00:00:00 2001 From: "Y. T. Chung" Date: Sat, 4 Jul 2015 02:40:15 +0800 Subject: [PATCH] use /proxy.pac --- proxy.pac | 2 +- src/bin/local.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy.pac b/proxy.pac index 648ab11e..85ecc07c 100644 --- a/proxy.pac +++ b/proxy.pac @@ -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, diff --git a/src/bin/local.rs b/src/bin/local.rs index d05d3e4c..b5452101 100644 --- a/src/bin/local.rs +++ b/src/bin/local.rs @@ -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; }, _ => {