2014-08-31 44 views
2

我可以set proxy腳本:如何在phantomjs中禁用代理設置?

phantom.setProxy('192.168.1.42', 8080, 'http', 'user', 'passwd'); 

但我怎麼能在腳本中禁用之前的代理無需重新啓動phantomjs

我想寫一個phantomjs渲染服務,它接受每個請求的proxy參數(可選)。

+0

有趣的是,這個函數甚至沒有記錄在這裏:http://phantomjs.org/api/phantom/沒有其他代理函數,請參閱https://github.com/ariya/phantomjs/blob/master/src /phantom.h – 2014-08-31 10:37:47

+0

如果您調用'phantom.setProxy('');'?會發生什麼?它會重置正確嗎? – 2014-08-31 10:43:47

回答

1

最近纔剛剛發現setProxy(),並已用它進行試驗,所以我會分享,是的,做

phantom.setProxy(""); 

並重置代理在PhantomJS,有些頁面已被打開後還是一樣。