2010-03-14 131 views
1

感謝大家提前。Jaxer和HTTP代理請求

我使用Jaxer.sandbox並提出請求就好了。我希望這些請求通過我的http代理(例如魷魚)。這是我目前爲我工作的代碼。

window.onload = function() { 
//the url to scrape 
var url = "http://www.cnn.com/"; 

//our sandboxed browser 
var sandbox = new Jaxer.Sandbox(); 

//open optons 
var openOptions = new Jaxer.Sandbox.OpenOptions(); 
openOptions.allowJavaScript = false; 
openOptions.allowMetaRedirects = false; 
openOptions.allowSubFrames = false; 
openOptions.allowSubFrames = false; 
openOptions.onload = function() { 
    //do something onload 
}; 

//make the call 
sandbox.open(url, null, openOptions); 

//write the response 
Jaxer.response.setContents(sandbox.toHTML()); 
}; 

如何通過代理服務器發送此請求?

謝謝,

禮薩。

回答

1

我沒有得到任何答覆。 :|

我們最終通過在jaxer框架中創建了自己的自定義sandbox.openProxy()方法來解決這個問題。 :)

Reza。

+0

這是一個真正有問題的問題。你能發佈這個自定義的sandbox.openProxy()方法嗎? – ideotop 2010-04-30 15:22:57