APE (Ajax Push Engine) is a scalable comet or AJAX push server written in C. It’s great for embedding HTML chat clients or making real-time games without Flash.
I’ve been playing around with APE for a couple different applications. Setting up the demos on a single server that runs both Apache and the APE server is relatively straight forward. However, running the APE server separate from the web server is not as simple.
Here’s my dev environment…
- Web server: Ruby on Rails running locally on my mac at http://0.0.0.0:3000
- APE server: running in a Debian VMWare server at http://192.168.0.99:6969
Here’s what you have to do to get the dev environment setup from scratch…
- Download APE Project
- Follow the APE doc for installing the server
- Create a new rails project and copy the ape-jsf folder into your rails project’s public dir
- Edit /etc/hosts on your mac and add the entries below
- Edit ape-jsf/Demos/config.js as directed below
- Modify JS Request methods to use GET instead of POST
Add to /etc/hosts
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3
Last but not least, edit ape-jsf/Tools/Check/index.html and modify all Request calls to use GET instead of POST. By default, MooTools Request object uses POST for XHR requests which will cause a problem with Rails.
1 2 3 4 5 6 7 8 9 10 11
The test script should now run properly at http://dummy-domain.com:3000/ape-jsf/Toosl/Check/
Thanks to the APE dev team for making an awesome comet server!