You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

iopa-tcp

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iopa-tcp

API-First Transport Control Protocol (TCP) stack for Internet of Things (IoT), based on Internet of Protocols Alliance (IOPA) specification

1.4.3
latest
Source
npmnpm
Version published
Weekly downloads
122
1425%
Maintainers
1
Weekly downloads
 
Created
Source

IOPA
iopa-tcp

Build Status IOPA limerun

NPM

About

iopa-tcp is an API-First Transport Control Protocol (TCP) stack for the Internet of Things (IoT), based on the Internet of Protocols Alliance (IOPA) specification

It servers TCP messages in standard IOPA format and allows existing middleware for Connect, Express and limerun projects to consume/send each mesage.

It is an open-source, standards-based, lighter-weight replacement for other TCP clients and brokers

Written in plain javascript for maximum portability to constrained devices, and consumes the standard node.js require('net') library

Makes TCP connections look to an application like a standard Request Response REST (HTTP-style) message so little or no application changes required to support multiple REST protocols on top of this transport.

Status

Fully working prototype include server and client.

Includes:

Server Functions

  • app.createServer
  • close

Client Functions

  • connect

Installation

npm install iopa-tcp

Install typings for Intellisense (e.g., Visual Studio Code, Sublime TSD plugins, etc.)

npm run typings

Example usage

const iopa = require('iopa')
  , tcp = require('iopa-tcp')
 
var app = new iopa.App();

app.use(tcp);

app.use(function (context, next) {
  context["server.RawStream"].pipe(process.stdout);
  return next();
});

if (!process.env.PORT)
  process.env.PORT = 1883;

app.createServer("tcp:", { port: process.env.PORT, address: process.env.IP })

  .then(function (server) {
    return server.connect("mqtt://127.0.0.1");
  })
  
  .then(function (client) {
      client["server.RawStream"].write("Hello World\n");
    });
    
  })

Keywords

limerun

FAQs

Package last updated on 05 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts