uupaa.xhrproxy.js

XMLHttpRequest proxy for Browser and WebWorkers

Usage no npm install needed!

<script type="module">
  import uupaaXhrproxyJs from 'https://cdn.skypack.dev/uupaa.xhrproxy.js';
</script>

README

XHRProxy.js Build Status

npm

XMLHttpRequest Proxy for Browser and WebWorkers.

Document

How to use

Browser

<script src="lib/XHRProxy.js"></script>
<script>
XHRProxy.get("./index.html", function(error, responseText, xhr) {
    console.log(responseText);
});
</script>

WebWorkers

importScripts("lib/XHRProxy.js");

XHRProxy.get("./index.html", function(error, responseText, xhr) {
    console.log(responseText);
});

Node.js

Use NodeProxy.js.

var NodeProxy = require("uupaa.nodeproxy.js");

NodeProxy.get("./index.html", function(error, responseText, xhr) {
    console.log(responseText);
});