Skip to content Skip to sidebar Skip to footer

Server Sided Proxy On Blogger

On my blogger page i have a function that makes a XMLHttpRequest to an external domain. Apparently, it doesn't work because of the cross-domain restrictions. Is it possible to set

Solution 1:

You can use what has become known as JSONP, but only if the site you're calling provides an API that will return a response in the correct format.

Otherwise, yes, it is generally possible to implement server-side proxy support on top of any web container. This requires that you have direct access to the server (i.e. it won't work if your site is hosted on blogger.com), and the exact specifics will vary depending upon your implementation language and web container. The high-level flow is very simple, however:

  1. The client calls back to the server with a request like /proxyRequest?url=http://www.crossdomain.com/someNeatThing, using a standard XMLHttpRequest.
  2. The server fires off its own request to 'http://www.crossdomain.com/someNeatThing', grabs the response, and pipes it back to the client as the result of the proxyRequest call.

Post a Comment for "Server Sided Proxy On Blogger"