sit

socket.io-test-pool

Creates socket.io clients, connects them to your server and returns the socket.io objects on both sides

Showing:

Popularity

Downloads/wk

4

GitHub Stars

0

Maintenance

Last Commit

9yrs ago

Contributors

1

Package

Dependencies

1

License

BSD-2-Clause

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Socket.io pool for testing

This module creates a set of sockets and returns both the client-side and server-side sockets. It is mainly meant for testing socket.io apps.

Installing

npm install socket.io-test-pool

Usage

var createsocketiopool = require('../src/socket.io-test-pool');
createsocketiopool(socketioServer, serverAddress, numberOfSockets, callback);

Example

var createsocketiopool = require('socket.io-test-pool');

var ioserver = require('socket.io').listen(3006);

createsocketiopool(ioserver, 'http://localhost:3006', 4, function(err, result) {

    clientSockets = result[0];
    serverSockets = result[1];
    serverSockets[2].on('hello', function() { console.log('it works!'); });
    clientSockets[2].emit('hello');

});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100