XX-net / XX-Net

A proxy tool to bypass GFW.
33.08k stars 7.69k forks source link

There was a problem loading, finding, or parsing the PAC: expected expression, got '<' #1365

Open GreatBigWhiteWorld opened 9 years ago

GreatBigWhiteWorld commented 9 years ago

使用8086端口的proxy.pac时,火狐的代理插件foxyproxy会报错

“exceptiong while determining which host to use for proxying"

这个pac文件格式是不是有问题?

xxnet commented 9 years ago

PAC里没有发现 < 符号啊 你访问 http://127.0.0.1:8086/proxy.pac 看看内容有什么异常

2015-11-12 9:46 GMT+08:00 GreatBigWhiteWorld notifications@github.com:

使用8086端口的proxy.pac时,火狐的代理插件foxyproxy会报错

“exceptiong while determining which host to use for proxying"

这个pac文件格式是不是有问题?

— Reply to this email directly or view it on GitHub https://github.com/XX-net/XX-Net/issues/1365.

GreatBigWhiteWorld commented 9 years ago

麻烦你看下这个: http://verihy.me/posts/foxyproxy-pac/ 错误类型是一样的。

GreatBigWhiteWorld commented 9 years ago

我加上了 if (host == undefined){ return direct; } 后变成这样,但是还是有那个错误一直弹出。 // Proxy Auto-Config file generated by autoproxy2pac, 2015-07-18 13:53:30 function FindProxyForURL(url, host) { if (host == undefined){ return direct; }
var autoproxy = 'PROXY 127.0.0.1:8087'; var blackhole = 'PROXY 127.0.0.1:8086'; if (dnsDomainIs(host, '.google.com') || dnsDomainIs(host, '.google.com.hk') || dnsDomainIs(host, '.google-analytics.com') || dnsDomainIs(host, '.googleapis.com') || dnsDomainIs(host, '.googlecode.com') || dnsDomainIs(host, '.googlevideo.com') || dnsDomainIs(host, '.googleusercontent.com') || dnsDomainIs(host, '.ggpht.com') || dnsDomainIs(host, '.wikipedia.org') || dnsDomainIs(host, '.sf.net') || dnsDomainIs(host, '.sourceforge.net') || host == 'cdnjs.cloudflare.com' || host == 'wp.me' || host == 'ow.ly' || host == 'po.st' || host == 'goo.gl') { return autoproxy; } if (host == 'pagead2.googlesyndication.com' || host == 'p.tanx.com' || host == 'a.alimama.cn' || FindProxyForURLByAdblock(url, host) != 'DIRECT') { return blackhole; } else { return FindProxyForURLByAutoProxy(url, host); } }

xxnet commented 9 years ago

同样的PAC在Chrome SwitchySharp 里能否工作?

调试方法:先把PAC的内容保存为文件,然后设置这个文件为PAC,通过手动修改文件内容,把不相关的内容先删除, 找到问题所在。

2015-11-12 10:45 GMT+08:00 GreatBigWhiteWorld notifications@github.com:

我加上了 if (host == undefined){ return direct; } 后变成这样,但是还是有那个错误一直弹出。 // Proxy Auto-Config file generated by autoproxy2pac, 2015-07-18 13:53:30 function FindProxyForURL(url, host) { if (host == undefined){ return direct; }

var autoproxy = 'PROXY 127.0.0.1:8087'; var blackhole = 'PROXY 127.0.0.1:8086'; if (dnsDomainIs(host, '.google.com') || dnsDomainIs(host, '.google.com.hk') || dnsDomainIs(host, '.google-analytics.com') || dnsDomainIs(host, '.googleapis.com') || dnsDomainIs(host, '.googlecode.com') || dnsDomainIs(host, '.googlevideo.com') || dnsDomainIs(host, '.googleusercontent.com') || dnsDomainIs(host, '.ggpht.com') || dnsDomainIs(host, '.wikipedia.org') || dnsDomainIs(host, '.sf.net') || dnsDomainIs(host, '.sourceforge.net') || host == 'cdnjs.cloudflare.com' || host == 'wp.me' || host == 'ow.ly' || host == 'po.st' || host == 'goo.gl') { return autoproxy; } if (host == 'pagead2.googlesyndication.com' || host == 'p.tanx.com' || host == 'a.alimama.cn' || FindProxyForURLByAdblock(url, host) != 'DIRECT') { return blackhole; } else { return FindProxyForURLByAutoProxy(url, host); } }

— Reply to this email directly or view it on GitHub https://github.com/XX-net/XX-Net/issues/1365#issuecomment-155980981.

GreatBigWhiteWorld commented 9 years ago

chrome switchysharp没问题,firefox自带的代理设置也没问题, 只有foxyproxy有问题,但是实在不知道怎么改,编程不是很懂。。

xxnet commented 9 years ago

怀疑foxyproxy自身的问题。

问题没有找出来,不好定位。

在 2015年11月12日 下午12:53,GreatBigWhiteWorld notifications@github.com写道:

chrome switchysharp没问题,firefox自带的代理设置也没问题, 只有foxyproxy有问题,但是实在不知道怎么改,编程不是很懂。。

— Reply to this email directly or view it on GitHub https://github.com/XX-net/XX-Net/issues/1365#issuecomment-155997728.

linhua55 commented 9 years ago

@GreatBigWhiteWorld 不是 return direct; 是 return "DIRECT";

在gfwlist2pac项目里生成的是这样定义direct的: https://github.com/zhangchunlin/gfwlist2pac/blob/master/gfwlist2pac/resources/proxy.pac#L8

GreatBigWhiteWorld commented 9 years ago

谢谢 @linhua55 已按照你的修改,不过这个错误还是在。 我也挺奇怪大家一般都用的什么?按说用火狐浏览器挺多的啊。这个问题其实很久了。。。

linhua55 commented 9 years ago

也是用的火狐,不过是国际版的。pac文件用的gfwlist2pac生成的。也是用的foxyproxy。还没出现问题。

linhua55 commented 9 years ago

proxy_abp_goagent.txt

GreatBigWhiteWorld commented 9 years ago

@linhua55 谢谢。我把你的下载了,重命名为proxy.pac然后放到xx-net/data/goagent/下覆盖了原文件,结果还是有这个错误啊。真是见了鬼了。

linhua55 commented 9 years ago

@GreatBigWhiteWorld 在FoxyProxy里,删除原有的xx-net的代理规则,重新添加一个,然后指定pac文件试试

GreatBigWhiteWorld commented 9 years ago

@linhua55 不行。我的是linux系统,英文版火狐。 不行就算了,凑合用吧。