agent.io

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agent.io

Real-time, scalable agent<->server messaging

latest
65

Supply Chain Security

100

Vulnerability

95

Quality

76

Maintenance

100

License

Deprecated

Maintenance

The maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.

Found 1 instance in 1 package

Non-existent author

Supply chain risk

The package was published by an npm account that no longer exists.

Found 1 instance in 1 package

Unpopular package

Quality

This package is not very popular.

Found 1 instance in 1 package

Wildcard dependency

Quality

Package has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.

Found 1 instance in 1 package

Dependencies have 5 high and critical alerts.

Critical CVE, Socket optimized override available, and Obfuscated code

Version
0.1.6
Version published
Maintainers
1
Created

Agent.io - Real-time, scalable agent<->server messaging for Node.js

Agent.io is a simple long polling based Node.js messaging library. It is usefull for use cases, where agents having no inbound access have to talk to servers in both directions in real-time.

The server part currently relies on Express and Redis. Redis pubsub is used to enable scaling out of servers to serve more agents. Please make sure Redis library is installed npm install redis. Redis >= 2.6 is recommended if multiple servers are used.

I might add WebSocket transport at some point if it is proved to be well supported and reliable for server to server use cases.

Installation and Usage

Install Agent.io with npm both on client and server

npm install agent.io 

Agent-side usage

var agentio = require('agent.io');

/* if no group name is specified, a unique id will be assigned to the agent */
var agent = agentio.createClient({group: 'group1', server: 'http://localhost:3000'});

/* listener for messages, which server sends to "group1" */
agent.on('message', function(msg) {
});

/* sending a message to the server */
agent.send({field: "value"});

Server-side usage

/* agent.io */

var agentio = require('agent.io');

var server = agentio.createServer();

/* group1 message listener */
server.on('group1', function(msg) {
});

/* listener for messages from all groups */
server.on('message', function(group, msg) {
});

/* listener for messages from all groups. Returns an array of all 
 * messages sent during one second or single event loop cycle.
 */
server.on('messages', function(group, msgs) {
});


/* sending a message to agent */
server.send('group1', {field: "value"});



/* express app */

var express = require('express');
var app = express.createServer();

app.configure(function(){
  app.use(express.methodOverride());
  app.use(express.bodyParser());
  app.use(server.middleware()); // agent.io server
});

app.get('/', function(req, res){
  res.send('Hello World');
});

app.listen(3000);

License

Copyright (c) 2012 Dmitri Melikyan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FAQs

Package last updated on 15 Aug 2012

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