Press Release – December 7th, 2009 – Weelya announces version 1.0 of its Ajax Push Engine (APE)
The most complete COMET solution for building real-time web applications.
MONTPELLIER, France, december 7th 2009 – Weelya SARL, announces today the availability of a major release of its Open Source project «APE» (Ajax Push Engine). With two years in the making, this 1.0 version finally enables anyone to build real-time web applications. APE fully meets the real- world requirements of the real-time web: reliability, extensibility and ease of development, especially with the added support for ServerSide JavaScript.
APE is the answer to a major problem:
Businesses and developers are faced with a problem that is becoming more common as they build web applications today. Whenever the need for interconnecting several data sources and several users occurs, there isnʼt a single viable solution in terms of reactivity, reliability and reduced server load. The «real-time web» is not easily achievable given all the technical constraints of the available technology.
The existing technical solutions all have important drawbacks. For example in the traditional web model, the user is blind and doesnʼt «see» the current state of the web server. Indeed, in order to be notified of newly available information, the web browser must ask for data itself by periodically sending requests to the web server. As a result, the server must face constant demands from all its users and the availability of data quickly becomes unreliable.
With APE, Weelya has turned the tables around by proposing an innovative technical model that fully respects web standards (does not require any client add-on) and which allows the server to send information to the client directly as it becomes available. The result is that users are no longer blind and can simply wait for the data to arrive in real-time, «pushed» by the server.


Get familiar with APE and its push technology through the «The amazing APE Comics».
http://www.ape-project.org/en/comics/1/Chapter-I-common-let-s-push.html
A short comic book explaining the APE workings in a playful way.
Shake up your website with APE :
Be creative ! Push back the limits of the web thanks to this push technology made easily available with APE. The web is all about the real-time interactions now and APE makes all these applications possible. Create your own Google Wave, your own «Facebook chat», your online web poker room or simply your own real-time data stream easily and rapidly with APE.
The only limit of APE is your imagination. APE can be used in many domains:
- Games (MMORPGs on the web, strategy…)
- Finance (Stock Market…)
- Chat & Social Networks (Notifications, IM, real-time news…)
- Telecommunications
- E-commerce (Online bidding, shops…)
- Real-time statistics
- Etc…
As an added bonus, APE can easily be integrated into your existing architecture no matter what your current framework and server programming language is and can usually enable data push from an external source in only two lines of code!
APE, an end-to-end solution:
Reactivity: APE brings a solution to the real-time paradigm. The information is relayed to the client within 100 milliseconds, whereas in the classic web model, requests are made periodically by the client.
Server load reduction: APE dramatically reduces server load (as seen in Fig. 2) since it doesnʼt have to handle a wagon of requests anymore. Handle thousands of users easily!
Scalability: APE can support 100, 000 users on a single server node.
A powerful server but also a client Framework : Contrary to most other COMET solutions, APE contains a client piece (a complete OpenSource JavaScript framework) which allows to handle communication with the APE server easily by providing hooks to receive, send, handle, and display information. Build your application easily by concentrating on its features and not on the many technical workings of Ajax, push and browser compatibility.
Extensible: The APE server is built from the ground up to be fully extensible. The modular architecture allows to add new functionality around the processing of sent and received data. This is now also largely facilitated by the addition of ServerSide JavaScript support, allowing developers to use the same programming language on the client and on the server.
New features in APE 1.0
New and improved communication protocol :
- Entirely using JSON and fully extensible.
- Several commands can be nested in one request.
New transport methods :
- XHRStreaming : A single connection is used to send and receive data. Better performance and reduced transfer delays.
- JSONP : Allows to place «cross-domain» requests.
Support for BSD & Mac OS X (running the APE server).
(Implemented by using KQueue) ServerSide JavaScript (SSJS) Implemented by using TraceMonkey (Mozilla SpiderMonkey)
Mootools support on the server side.
Complete Server-Side JavaScript API:
- Handling of users, RAWs, Commands, Channels, Sockets
- Use of non-blocking sockets (Client & Server)
- MySQL connector module
- API for doing external HTTP requests
- WebHooks
Log files for errors, access and general information
About Weelya
Weelya is an innovative startup. We have been experts and enthusiasts of the web since its dawn, and our goal is to help improve the technology by contributing to the community. Open Source is our philosophy and guides us in finding solutions. All our projects are designed to help «improve the web».
APE was born more than four years ago as we were still students. Formerly named ACE (for Ajax Chat Engine) and oriented towards real-time chat, it rapidly evolved to become the first available COMET server. In 2008, the project moved closer to completion when Weelya was founded.
Weelya is also making available today a companion website for the APE project called «APE More». This website will allow developers to share their modules and extensions as well as full applications. APE More: http://more.ape-project.org.
Finally, Weelya now proposes professional web services around APE, such as for example specific development of modules and applications, consulting, audit, training and a ticketing support system. Do not hesitate to contact us with regards to your online project.
Press Enquiries:
John Chavarria, CEO
+33-(0)-4-67-169-778
contact@weelya.com
Weelya SARL,
32 rue du Faubourg Boutonnet
34090 Montpellier
FRANCE
Resources:
Weelya and APE logo http://www.weelya.com/logo/
Fore more information:
http://www.ape-project.org/
http://www.weelya.com/
Technical addendum
APE is a complete Open Source solution designed for Ajax Push. The project includes a web server and a Javascript Framework. APE allows to easily implement any type of real-time data streaming between a web server and a web browser without any required add-ons on the client side.
The project is divided in two distinct parts. The first one is the HTTP streaming server (COMET) called the APE Server. The second part, the APE Javascript Framework, receives the data on the client side thanks to the APE Protocol.
APE Protocol
The APE protocol uses JSON and has been designed specifically for data push. The protocol allows to send and receive several Commands (client -> server) and RAWs (server -> client) in a single AJAX request contrary to other existing push protocols. This functionality allows to greatly reduce the number of requests between the client and the server.
The client starts the connection by sending the CONNECT command:
[
{"cmd":"CONNECT","chl":0,"params":{"transport":0}}
]
The server replies with two RAWs in a single request:
[
{"raw":"LOGIN","time":"1253633967","data":{"sessid":"4622c258248931a7dfb081542eaf589f"}},
{"raw":"IDENT","time":"1253633967","data":{"user": {"casttype":"uni","pubid":"5288a462f528d3609777f31872d31c8d"}}}
]
The APE protocol is based on a «publisher / subscriber» model, allowing to exchange data in «one-to-one» or «one-to-many».
The APE JavaScript Framework
The APE JavaScript Framework was created in order to ease the client/server communication and to add an abstraction layer, allowing developers to focus on their application and not on how the data is transmitted. The APE JavaScript Framework (JSF) also offers a solution to many common problems found in other COMET packages (No more constant page load, good handling of memory and of the DOM model, multi-browser support, mobile support, automatic reconnection with the server, etc…)
The APE JSF is based on the OpenSource Mootools library, offering good performance and easy maintenance. However, developers can of course use another framework for building their app (JQuery, Dojo…).
Sample of client/server communication using the APE JSF :
Server side code (in a module for example):
Ape.registerCmd("myCommand", true, function(params, info) {
// Output the information to be received
Ape.log("Receiving data, location is : " + params.location);
// Push info to the client
infos.user.pipe.sendRaw('myRaw', {'msg': 'Your information has been received'});
return 1;
});
Client side handling:
var client = new APE.Client();
// Connection to the APE Server
client.load({'connectOptions': {'name': prompt('Your name please : ')}});
client.addEvent('ready', function() {
// Sending info to the Server
client.core.request.send('myCommand', {'location': prompt('What is your location?')});
});
// Catching pushed info
client.onRaw('myRaw', function(param) {
alert(param.data.msg);
});
Sessions – Multi tabbing / windowing :
Sessions in APE allow an application to be persistent across the pages of your website. If the user navigates to another page on your website, APE will restore the session and the data without any further coding required.
Thanks to its unique protocol, APE allow to natively code your application to support multiple windows and multiple tabs. If a user is currently seeing two pages of your website, the incoming information will be received by both.
A server-side data storage feature is also available for your app to store information required to be persisted during the session.
Sample of storing and retrieving session data to and from the server:
// Store a session variable
ape.setSession({'myKey':'value'});
// Retrieve a session variable
ape.getSession('myKey', function(response) {
alert(resp.datas.sessions.myKey);
});
TCPSockets (APE as a middleware) :
The APE JSF fully implements the TCPSocket interface, allowing to open a persistent connection to any other server or service – directly in JavaScript from the client side. Thanks to this interface the APE JSF supports many protocols through the js.io library (XMPP, IRC, STOMP…).
The APE Server :
Since the APE server is built to be scalable, lightweight and modular it was entirely written in C with the network layer using epoll (kqueue on BSD). This allows fast execution and large load handling (more than 100, 000 users). However, the server also features a JavaScript API through the use of the blazing fast TraceMonkey (Mozilla SpiderMonkey).
The publisher/subscriber model is based on a «channel» system (communication channels) that allow to broadcast data to a group of users. It is also possible to send data to a specific user directly. Channels and Users in APE are fully extensible and can be modified to include additional properties.
The APE server implements an internal message queue to relay messages to all its users.
Sample «one-to-one» communication:
user.pipe.sendRaw('rawName', {'param1': 'value', 'param2': ['king', 'kong']});
Sample «one-to-many» communication:
channel.pipe.sendRaw('rawName', {'param1': 'value', 'param2': ['king', 'kong']});
These high level functions automatically add the new messages to the message queue and then deliver them. The developer does not have to worry about internal handling.
Sockets :
Extend the capabilities of your real-time application by interconnecting it with any other server or service through the sockets system. You can even create an internal socket server in APE!
Client socket sample:
//Instantiating a socket client is simple
var socket = new Ape.sockClient('21', 'example.com', {flushlf: true});
socket.onConnect = function() {
Ape.log("Connected to example.com");
this.write("Hello\n");
}
socket.onRead = function(data) {
Ape.log("Data : " + data);
}
socket.onDisconnect = function() {
Ape.log("Gone !");
}
Serveur socket sample:
//Here we create a server that listen on all ips on port 80
var socket = new Ape.sockServer("80", "0.0.0.0", {flushlf: true});
socket.onAccept = function(client) {
Ape.log("New client !");
client.write("Hello world\n");
}
socket.onRead = function(client, data) {
Ape.log('Received data:'+data);
if(data == 'bye') {
client.close();
}
}
MySQL:
Easily use your existing MySQL database from APE.
Sample SQL request in APE:
sql.query("SELECT * FROM table", function(res, errorNo) {
if (errorNo) Ape.log('Request error : ' + errorNo + ' : '+ this.errorString());
else {
Ape.log('Fetching ' + res.length);
for(var i = 0; i < res.length; i++) {
Ape.log(res[i].title);//res[i].
}
}
});
WebHook / HTTP :
Call an external URL or fetch a web page from APE thanks to the native handling of HTTP requests.
Updating a twitter status with APE:
var request = new Http('http://twitter.com:80/statuses/update.json');
request.set('action', 'POST');
// GET or POST data
request.writeData('status', 'Hello!');
// HTTP Auth
request.set('auth', 'user:password');
request.getContent(function (result) {
Ape.log(result);
});
Inline Push :
Send information to the APE server directly from an external application. The information will be relayed to the clients by APE!
Sample inline push from PHP:
$cmd = array(array( 'cmd' => 'inlinepush', 'params' => array( 'password' => ‘your_inlinepush_password’, 'raw' => 'postmsg', 'channel' => 'testchannel' 'data' => array( 'message' => 'hello world!' ) ) )); $data = file_get_contents(‘http://ape.ape-project.org/’.rawurlencode(json_encode($cmd))); // This will push the RAW «postmsg» to the «testchannel» Channel.
For even more technical information:
The APE website: http://www.ape-project.org/
The APE documentation: http://www.ape-project.org/en/docs/
The APE wiki: http://www.ape-project.org/wiki/
Thank you for reading!
Need info?
Drop us an email!
You need more info about our products or services? Drop us a line below and send your request!
