mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-02-09 01:59:16 +08:00
use /proxy.pac
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
_ => {
|
||||
|
||||
Reference in New Issue
Block a user