Replay Splash
Clones N Barrels
SubSpace 2
Bring to front
08:02:10 AM

SubSpace 2

Subspace 2 is a demo project to show off Kalisti, as well as the Subspace client and server libraries.

View the demo

Using the Demo

You'll want to open this application up in two tabs They can be on different browsers, on different machines or on completely different networks. Everything should work just the same.

Getting ready to receive data.

Type sub 0 to subscribe to channel 0. Since this channel name is an integer, the channel is automatically marked as binary. You can also type sub new_channel to subscribe to a text based channel to see how they're different.

Sending data

On the other tab, type pub 0 1 2 3 to send the bytes 0x0 0x1 0x2 to everyone subscribed to channel 0.




Kalisti provides a way to define channels. They're named like so; game:0x000F:main, game:0x000F:chat, chatroom:#meta, chatroom:#lounge.

The names are separated by colons, and are addressable individually or by selector. Selectors may contain wildcards (*), numerical wildcards (#) or ranges (0x0000-0xFFFF). Selectors may match to names or other selectors. Selector y would match selector x if and only if all individual names matches by y would also be matched by x. In other words, selector y matches selector x if it is a more specific version of x.

Messages may be published to a hub. Hubs have a set of channel selectors mapped to channel class names. The default mapping is simply ['*' => 'SeanMorris\Kalisti\Channel']. Since all channels names/selectors will match a bare *, any channel can be created.The channel SeanMorris\Kalisti\Channel will simply relay any messages to all subscribed agents.

Server Library

The SubSpace Server provides a WebSocket server application, as well as an authentication facility implemented in ids & presskit.

The library is available on Packagist.

Client Library

The library is available on npm.

links go here
Back to top