Project DescriptionASP.NET and Javascript proxies for accessing external content.
The ASPX file can be used for returning external content over the current channel (HTTP/SSL).
Used with the ASPX, the JS file can provide remote server access (no "same origin policy") with XMLHttpRequest syntax.
SSL Proxy
Sometimes your web or intranet site is served over SSL but you'd like to include content from an insecure (HTTP-only) website. With this proxy, you can route requests to external sites through your own SSL certificate just by adding it to a query string.
ExampleRequests for
http://example.com would become requests for
netproxy.aspx?http://example.com.
Javascript Proxy
Another common goal is to incorporate content from third-party sites, but Javascript has a "same origin policy" restriction meaning you can only access files on your own domain. With this proxy, you can GET content from or POST content to any server in the world using the familiar XMLHttpRequest syntax. All methods and properties are wrapped, meaning only the object declaration needs to be changed.
Example// Pass in the URL for our proxy ASPX page
var bingProxy = new netProxy("http://bing.com");
bingProxy.onreadystatechange = function(){
if (bingProxy.readyState == 4)
alert('Source code for http://bing.com:\r\n\r\n' +bingProxy.responseText);
};
bingProxy.open("GET", "http://bing.com", true);
bingProxy.send();
For other projects by this author, visit
http://bertjohnson.net.