This package has been deprecated

Author message:

SRP is deprecated protocol

sr-protocol

1.0.0 • Public • Published

Send and Return Protocol

This package is for make SRP server / client.

Usage

var express = require("express");
var srp = require("srp");
var app = express();
app.use(srp.server(/*option*/));

Option of require("srp").server()

  • Object
    • path (Optional, default is /) Changes the path where SRP opens.

    • command (Optional, default is {}) Makes the commands.

      Usage:

      {
        command: {
          name: function(socket, args, sockets, response){
            // socket contains socket of sender.
            // args contains arguments of the command.
            // sockets contains all sockets.
            // response contains response of socket.
          }
        }
      }

Format of SRP

SRP uses hex for messages.

  • Request Example:

    &cmd:4d657373616765
    &REM:It's a comment, so it does nothing
    

    (4d657373616765 means Message in hex)

  • Response Example:

    SRP/0.1 0 SUCCESS
    #ERR:4572726f72
    #REC:5265636569766564206d657373616765
    

    (4572726f72 means Error in hex) (5265636569766564206d657373616765 means "Received message" in hex)

Readme

Keywords

Package Sidebar

Install

npm i sr-protocol

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

4.58 kB

Total Files

4

Last publish

Collaborators

  • npmisgood