# @lesomnus/vanguard

> Signaling with data channel

Latest version **0.0.2** (published 2023-06-06) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @lesomnus/vanguard
pnpm add @lesomnus/vanguard
yarn add @lesomnus/vanguard
bun add @lesomnus/vanguard
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2023-06-06 |
| First published | 2023-06-05 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 78.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Seunghyun Hwang |
| Maintainers | lesomnus |

## Links

- npm: https://www.npmjs.com/package/@lesomnus/vanguard
- npm.io page: https://npm.io/package/@lesomnus/vanguard

## Dependencies (1)

- [events](https://npm.io/package/events.md) ^3.3.0

## Recent versions

- 0.0.2 (latest) — 2023-06-06
- 0.0.1 — 2023-06-05

## README

# Vanguard

Make extra connections from the existing connection.

## Usage

```ts
import { SigChannel, SigMessage, offer } from 'vanguard'

class MySigChannel implements SigChannel {
	send(message: SigMessage): void {
		// Implement it.
	}

	close(): void {
		// Implement it.
	}

	get closed(): boolean {
		// Implement it.
	}
}

async function connect() {
	// Initial connection with third-party signalling server.
	const conn = new RTCPeerConnection()
	const peer = await offer(conn, new MySigChannel())

	// Need extra connection?
	// Signaling through existing connection!
	const extra_conn = new RTCPeerConnection()
	const extra_peer = await peer.offer(extra_conn)
}
```

## TODO

- [ ] Provide `SigChannel` for PeerJS.
- [ ] Handle renegotiation.

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