# socket.io-bundle

> A collection of middlewares for Socket.IO

Latest version **0.1.2** (published 2014-06-05) · 0 weekly downloads

## Install

```sh
npm install socket.io-bundle
pnpm add socket.io-bundle
yarn add socket.io-bundle
bun add socket.io-bundle
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2014-06-05 |
| First published | 2013-07-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Naoyuki Kanezawa |
| Maintainers | nkzawa |
| Keywords | middleware, rack, socket.io, connect |

## Links

- npm: https://www.npmjs.com/package/socket.io-bundle
- Repository: https://github.com/nkzawa/socket.io-bundle
- Issues: https://github.com/nkzawa/socket.io-bundle/issues
- npm.io page: https://npm.io/package/socket.io-bundle

## Dependencies (5)

- [csurf](https://npm.io/package/csurf.md) 1.2.0
- [debug](https://npm.io/package/debug.md) 1.0.0
- [morgan](https://npm.io/package/morgan.md) 1.1.1
- [cookie-parser](https://npm.io/package/cookie-parser.md) 1.1.0
- [express-session](https://npm.io/package/express-session.md) 1.2.1

## 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

- 0.1.2 (latest) — 2014-06-05
- 0.1.1 — 2014-05-02
- 0.1.0 — 2014-04-19
- 0.0.5 — 2013-12-10
- 0.0.4 — 2013-07-25
- 0.0.3 — 2013-07-17
- 0.0.2 — 2013-07-13
- 0.0.1 — 2013-07-07

## README

# Socket.IO-bundle
[![Build Status](https://travis-ci.org/nkzawa/socket.io-bundle.png?branch=master)](https://travis-ci.org/nkzawa/socket.io-bundle)

This is a collection of commonly used middlewares for [Socket.IO](https://github.com/LearnBoost/socket.io), which I wish Socket.IO was bundled with.
Socket.IO-bundle is based on [Express](https://github.com/visionmedia/express) middlewares, so that you can easily integrate with Express and Connect.

```js
var bundle = require('socket.io-bundle');
var server = require('http').Server();
var io = require('socket.io')(server);

io.use(bundle.cookieParser());
io.use(bundle.session({secret: 'my secret here'}));
io.use(bundle.csrf());

server.listen(3000);
```

Arguments for each middlewares are completely the same with Express's ones.
You must be aware of that `session` middleware can’t set cookies to clients due to the behavior of Socket.I.

### CSRF

Csrf tokens will be supplied to browsers via Express/Connect, and be sent to a Socket.IO server as a query parameter.

```js
// client
var socket = io('http://localhost:3000?_csrf=' + encodeURIComponent(_csrf));
```

## License
MIT

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