代理API无法正常工作

时间:2014-06-17 22:26:07

标签: crossrider

我正在尝试使用Crossrider的代理API。我只是从提供的示例中复制了代码,但是当我导航到whatismyip.com时,似乎并没有使用我的代理。我有一个在127.0.0.1:8877上运行的代理,我使用的代码是:

var whiteListDomains = ["whatismyip.com", "myglobalip.com"];
var proxyServer = "127.0.0.1:8877";

appAPI.proxy.set({ whiteListDomains: whiteListDomains, proxyServer: proxyServer });

我也尝试过:

appAPI.proxy.set({         pacScript:             “函数FindProxyForURL(url,host){if(/whatismyip.com$/.test(host))return'PROXY 127.0.0.1:8877;'; return'DIRECT';}”     });

这是我在appAPI.ready事件中放在background.js中的脚本。我正在使用Chrome。我需要做些什么特别的事吗?你能不能看看我有什么遗失的东西?

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

根据提供的信息,我猜测代理插件未添加到扩展程序中;因此,在扩展程序的我的项目面板中,点击添加插件,选择代理插件,然后将其添加到您的扩展程序中。< / p>

[披露:我是Crossrider员工]