UNPKG

ps2wss

Version:

A super simple extension of [WebSocket](https://github.com/einaros/ws) built to abstract away some of the complexity in working with [SOE's Planetside 2 Web Socket Service](http://census.soe.com/#ps2-websocket1).

19 lines (15 loc) 477 B
function handleLogin (payload) { console.log('PlayerLogin:', payload); } function handleLogout (payload) { console.log('PlayerLogout:', payload); } var stream = require('./index').connect('example', function () { stream.subscribe(['PlayerLogin', 'PlayerLogout'], {"worlds":["1"]}) .on('PlayerLogin', handleLogin) .on('PlayerLogout', handleLogout); }); setTimeout(function() { console.log('CLEAR!!!!!!!!!!!!!!!!!!!!!!!!!'); stream.clear(); },5000);