JavaScript can load HTML, XML or JSON data from a resource on the same domain, with only an XMLHttpRequest.
JavaScript can also load JSONP-formatted JSON data from another domain with only a predefined callback, plus some script-injection to get the data.
This proxy allows to request data from remote domains without the restrictions of JavaScript.
The developer's JavaScript code can get the desired content even if it’s not available in JSONP format.
Here are some key features of "Simple PHP Proxy":
· Requested URLs can be white-listed and validated against a regex.
· Optionally forward client cookies / SID to the remote server.
· Optionally forward configurable User Agent to the remote server.
· Requests can use either GET or POST request methods.
· Remote data can be delivered as-is with all remote headers intact (disabled by default to limit XSS vulnerabilites).
· Remote data can be wrapped in a JSON/P structure that includes status codes and remote headers (JSONP disabled by default to limit abuse).
· If using JSON/P and remote data is valid JSON, it will be merged into the resulting data object.
Requirements:
· JavaScript enabled on client side
· Web server
· jQuery (included in example, not a requirement)
What's New in This Release: [ read full changelog ]
· Defaults to JSON mode, which can now be changed to native mode by specifying ?mode=native. Native and JSONP modes are disabled by default, because of possible XSS issues, but are configurable in the PHP script along with a url validation regex.