Update README/TESTING for lack of proxy

This commit is contained in:
Tim Mickel 2014-09-05 15:25:41 -04:00
parent 21bbe425fa
commit d217cfecee
2 changed files with 3 additions and 46 deletions

View file

@ -19,8 +19,7 @@ Thank you for your interest in helping out with the Scratch HTML5 Player. [@scl
## Installation
Running the HTML5 player on your own website, or locally, you will need to have
PHP so that the `proxy.php` file can be used to load assets from the same domain. This is done to be compatible with Javascript security models in today's browsers. To test the HTML5 player against the Flash player you can use the compare.html web page.
Special headers are sent on the Scratch asset servers to allow for cross-origin image manipulation. A proxy is no longer needed provided you are using projects hosted on the Scratch website. This is compatible with Javascript security models in today's browsers. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image) for more information. To test the HTML5 player against the Flash player you can use the compare.html web page.
See the file `TESTING.md` for more details.

View file

@ -1,45 +1,3 @@
Running the HTML5 player on your own website, or locally, you will need to have
PHP so that the `proxy.php` file can be used to load assets from the same domain. This is done to be compatible with Javascript security models in today's browsers. To test the HTML5 player against the Flash player you can use the compare.html web page.
To set up the player for testing and development, simply download the source and open [index.html](https://github.com/LLK/scratch-html5/blob/master/index.html) in a recent web browser (Chrome, Firefox, Safari and other Webkit/Gecko-based browsers work best). You can also compare performance and features to the production Flash player by opening [compare.html](https://github.com/LLK/scratch-html5/blob/master/compare.html).
# Ubuntu
If you're using Ubuntu, you can follow the following steps to set up the proxy correctly. You'll need to type the following commands in Terminal.
Install PHP and Apache for running the proxy file:
$ sudo apt-get install apache2 php5
Fork this repository on Github, and then clone it into your home folder somewhere (replacing `<username>` with your Github username):
$ git clone https://github.com/<username>/scratch-html5
We'd like to add a new localhost domain, so that we can access the player from our web browser. Something like `scratch.localhost`. Run this command to edit the `/etc/hosts` file:
$ sudo nano /etc/hosts
Add the following line:
127.0.0.1 scratch.localhost
Use <key>Ctrl-O</key>, <key>Return</key>, <key>Ctrl-X</key> to quit.
Now we want to add a new Apache configuration for the new domain. Run the following:
$ cd /etc/apache2/sites-available/
$ sudo nano scratch
And type in the following, replacing `user` with your username, and making sure the `DocumentRoot` matches where you cloned the repository earlier:
<VirtualHost *:80>
ServerName scratch.localhost
DocumentRoot /home/user/scratch-html5
</VirtualHost>
Finally, run the following commands to enable the site:
$ sudo a2ensite scratch
$ sudo service apache2 reload
Now when you go to <http://scratch.localhost/>, the project should play. If you get a "Forbidden" error message, you may need to check the permissions of the folders that the player code is in.
Now you can go fix bugs in the HTML5 player!
The Scratch HTML5 player is no longer dependent on a local proxy.