# bosh

> A simple BOSH middleware

Latest version **0.1.2** (published 2012-10-14) · BSD license · 0 weekly downloads

## Install

```sh
npm install bosh
pnpm add bosh
yarn add bosh
bun add bosh
```

## 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 | 2012-10-14 |
| First published | 2012-09-10 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | aredridel |

## Links

- npm: https://www.npmjs.com/package/bosh
- npm.io page: https://npm.io/package/bosh

## Dependencies (3)

- [ltx](https://npm.io/package/ltx.md) ~0.2.2
- [idgen](https://npm.io/package/idgen.md) ~1.1.2
- [node-xmpp](https://npm.io/package/node-xmpp.md) ~0.3.2

## Recent versions

- 0.1.2 (latest) — 2012-10-14
- 0.1.1 — 2012-10-14
- 0.0.4 — 2012-09-29
- 0.0.3 — 2012-09-22
- 0.0.2 — 2012-09-19
- 0.0.1 — 2012-09-16
- 0.0.0 — 2012-09-10

## README

Introduction
============

This is a simple BOSH middleware (for anything with a connect-like API), or can
be used as a connection handler function for the raw node HTTP server.


Example
=======

    var http = require('http');
    var bosh = require('./bosh.js');
    http.createServer(bosh()).listen(5280);


Example as Connect middleware
=============================

    var connect = require('connect');
    var urlrouter = require('urlrouter');

    var app = connect();

    var bosh = require('./bosh.js');

    var router = urlrouter(function(app) {
        var boshHandler = bosh();
        app.post('/http-bind/', boshHandler);
        app.get('/http-bind/', boshHandler);
    });

    app.use(connect.logger({ immediate: true, format: 'dev' }));

    app.use(router);

    app.listen(5280);

Caveats
=======

It implements just enough of the connection manager protocol at this point to
pass through an XMPP session. Correctness is left for a later pass through the
code. There is little to no error handling.

There's still a glitch with libpurple clients dropping connections and
replacing them.

No multiple stream support yet.

No repeatable reads yet.

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