# cs-sockets

> Server for snappy text based websocketing in Node.js

Latest version **1.2.8** (published 2017-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install cs-sockets
pnpm add cs-sockets
yarn add cs-sockets
bun add cs-sockets
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.8 |
| Published | 2017-01-03 |
| First published | 2016-12-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Sean Codes |
| Maintainers | sean_codes |
| Keywords | websockets, RFC-6455, websocket, json-websocket-server, real-time |

## Links

- npm: https://www.npmjs.com/package/cs-sockets
- Repository: https://github.com/sean-codes/cs-sockets
- Homepage: https://github.com/sean-codes/cs-sockets#readme
- Issues: https://github.com/sean-codes/cs-sockets/issues
- npm.io page: https://npm.io/package/cs-sockets

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.2.8 (latest) — 2017-01-03
- 1.2.7 — 2017-01-03
- 1.2.6 — 2017-01-03
- 1.2.5 — 2017-01-02
- 1.2.4 — 2017-01-01
- 1.2.3 — 2017-01-01
- 1.2.2 — 2017-01-01
- 1.2.1 — 2017-01-01
- 1.2.0 — 2017-01-01
- 1.0.1 — 2016-12-31
- 1.1.0 — 2016-12-31

## README

# CS-Sockets
Pure NodeJS server for snappy string networking

Still a work in progress!
>npm install cs-sockets

# Purpose 
Text only based networking for simple JSON networking

# Performance
Local Machine ~3,000 per second 256 byte string Up/Down

100k 127byte strings Up/Down in 1 minute.

Remote ~500+ 256 byte string Up/Down (Coffee Shop Wireless Connection)


#Usage
###An echo server:

    const csServer = require('csServer');
    const server = new csServer({ port: '9999' });

    server.on('connect', function(socket){
        
    server.on('message', function(socket, message){
            this.send(socket, message);
        });
    });

###Starting CS-Sockets:

    const csServer = require('csServer');
    const server = new csServer({[options]})


###Socket Opens Connection:

    csServer.on('connect', [function(socket)]);

###Socket Sends Data:

    csServer.on('message', [function(message)]);

###Sending Data to a socket:

    csServer.send([socket to receive], message);

###Socket Disconnecting

    csServer.on('disconnect', [function(socket)])

###SSL Connections
To use your SSL and Key add a ssl field to your csServer options
>When the server starts you should see the message Starting Server (SSL)

    const server = new csServer({
        port: 9999,
        ssl: {
            key: '/etc/letsencrypt/archive/cube-script.net/privkey1.pem',//Your key path
            cert: '/etc/letsencrypt/archive/cube-script.net/fullchain1.pem'//Your Cert Path
        }
    });

---
_Source: https://npm.io/package/cs-sockets · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
