This package has been deprecated

Author message:

Do not use

@meteor-it/xpress-support-potato

1.0.2 • Public • Published

XPress Potato Socket support

What is Potato Socket?

This is a Websocket wrapper with packet (de)serialization tougth ProtoDef Also supports RPC

Read instruction in XPress to install

Usage:

server.on('POTATO /*',async(req, socket, next)=>{
    // Req here - custom object, have all props as on normal http requests
    // All types from protodef
    socket.addPacket('packetName',{
      field1:'string',
      field2:'i8',
      ...
    });
    next(); 
});
server.on('POTATO /a',async(req, socket, next)=>{
    req.a; // = 123
    socket.on('packetName', msg=>console.log.bind(console));
    // RPC
    await socket.remoteFunc(params)
});

Also see the potato.socket docs

Readme

Keywords

Package Sidebar

Install

npm i @meteor-it/xpress-support-potato

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • f6cf
  • lach