# hyperswarm-proxy-ws

> Proxy hyperswarm connections over websockets with auto-reconnect logic

Latest version **1.2.0** (published 2020-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install hyperswarm-proxy-ws
pnpm add hyperswarm-proxy-ws
yarn add hyperswarm-proxy-ws
bun add hyperswarm-proxy-ws
```

## 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.0 |
| Published | 2020-09-03 |
| First published | 2020-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | rangermauve |
| Maintainers | rangermauve |
| Keywords | hyperswarm, ws, websocket, dat |

## Links

- npm: https://www.npmjs.com/package/hyperswarm-proxy-ws
- Repository: https://github.com/RangerMauve/hyperswarm-proxy-ws
- Homepage: https://github.com/RangerMauve/hyperswarm-proxy-ws#readme
- Issues: https://github.com/RangerMauve/hyperswarm-proxy-ws/issues
- npm.io page: https://npm.io/package/hyperswarm-proxy-ws

## Dependencies (2)

- [hyperswarm-proxy](https://npm.io/package/hyperswarm-proxy.md) ^1.4.0
- [websocket-stream](https://npm.io/package/websocket-stream.md) ^5.5.0

## 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.0 (latest) — 2020-09-03
- 1.1.0 — 2020-08-24
- 1.0.1 — 2020-01-02
- 1.0.0 — 2020-01-02

## README

# hyperswarm-proxy-ws
Proxy hyperswarm connections over websockets with auto-reconnect logic

```
npm -s hyperswarm-proxy-ws
```

## Example

```js

const HyperswarmServer = require('hyperswarm-proxy-ws/server')

// Initialize the proxy server
// Also specify any options for hyperswarm here
// https://github.com/hyperswarm/hyperswarm
const server = new HyperswarmServer()

// Start listening on clients via websocket protocol
server.listen(3472)


const HyperswarmClient = require('hyperswarm-proxy-ws/client')

// Initialize a proxied hyperswarm
// Also specify any options for hyperswarm-proxy client
// https://github.com/RangerMauve/hyperswarm-proxy#client
const swarm = new HyperswarmClient({
  // Specify a list of proxy servers available to connect to
	proxy: ['ws://127.0.0.1:3472']
})

// Same as with hyperswarm
swarm.on('connection', (connection, info) => {
	const stream = getSomeStream(info.topic)

	// Pipe the data somewhere
	// E.G. hyperdrive.replicate()
	connection.pipe(stream).pipe(connection)
})

swarm.join(topic)

swarm.leave(topic)
```

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