Skip to content
Christopher Vagnetoft edited this page Jan 5, 2017 · 1 revision

Chromata is an experiment designed to find out if it is possible to present an application running under PHP (or technically any language that can read from standard input and write to standard output) in a HTML5-capable web browser or webapp container in real time. The DOM is created and bound on the server, sent to the browser over a websocket, and presented. Events go in the other direction; from the browser, over the same websocket, and to the server.

This would open up for many interesting uses:

  • Multiplayer games and interactions: The server can always be running, accepting requests from clients on the same network. With a bit of logic on the server side the different (per-user) application instances could communicate and share states and info. Alternatively, with two people on the same network, one could start up the server and the other could connect to it.
  • Powerful local web applications: While using HTML for the presentation, these applications would have the power of the server-side script. You could for example collect information to update charts and statistics for a server or service, and present it whenever a browser is connected, without having to bother with APIs, transports etc.
  • ...

Haxe is used to generate the client side JS library. A compiled version is included in the repository, but it can be rebuilt on demand with haxe build.hxml.

The source code is currently not overly pretty, as it is still very experimental, yet functional.

Clone this wiki locally