Skip to main content

Playground

Everything on this page runs in your browser: the panel on the right is a real X session served by the pure-JavaScript X server that ships with this repository, composited to a canvas. The editor holds ordinary node-x11 client code — the same code you would run in node against a real display — connected through a custom DISPLAY transport (demo/local:0). Edit it and press Run, or press Share for a link that carries the whole snippet in its query string — there is no server storing any of this.

This is the slow way to run an X server. Everything here is emulation: the server is JavaScript, rasterizing into a canvas on the same main thread as the editor, and input reaches it by postMessage across an iframe boundary. On a desktop your client talks over a unix socket to a real X server — C, usually GPU-accelerated — which does the compositing and glyph drawing itself. Judge the protocol here; judge the performance there.

Hello window

Create and map a window with a title and background, then draw a greeting.

Loading live demo…