diff --git a/js/IO.js b/js/IO.js index 26ef3c6..ddf561d 100644 --- a/js/IO.js +++ b/js/IO.js @@ -28,9 +28,9 @@ var IO = function() { // since we won't be hampered by the same-origin policy. this.base = 'proxy.php?resource=internalapi/'; //this.base = 'http://scratch.mit.edu/internalapi/'; // Final base - this.project_base = this.base + 'project/'; + this.project_base = 'proxy.php?domain=projects.scratch.mit.edu&resource=internalapi/project/'; this.project_suffix = '/get/'; - this.asset_base = this.base + 'asset/'; + this.asset_base = 'proxy.php?domain=cdn.scratch.mit.edu&resource=internalapi/asset/'; this.asset_suffix = '/get/'; this.soundbank_base = 'soundbank/'; this.spriteLayerCount = 0; diff --git a/proxy.php b/proxy.php index 7c541c4..cdbc420 100644 --- a/proxy.php +++ b/proxy.php @@ -6,7 +6,7 @@ * proxy.php should be removed from the server. */ -$resource = 'http://scratch.mit.edu/' . $_GET['resource']; +$resource = 'http://' . (isset($_GET['domain']) ? $_GET['domain'] : 'scratch.mit.edu') . '/' . $_GET['resource']; // Strip the /get/ suffix for calculating the extension // and then get the file extension to pass on to the browser.