@authmesh/relay
v0.1.4
Published
WebSocket relay server for amesh device pairing handshakes
Maintainers
Readme
@authmesh/relay
WebSocket relay server for amesh device pairing handshakes.
The relay is only needed during initial device pairing. After two devices exchange public keys, all authentication is stateless HTTP headers --- the relay is not involved.
Install & Run
bunx @authmesh/relay # run directly
# or
npm install @authmesh/relay && node -e "import('@authmesh/relay').then(m => m.createRelay())"Environment variables
| Variable | Default | Description |
|----------|---------|-------------|
| HOST | 0.0.0.0 | Listen address |
| PORT | 3001 | Listen port |
Endpoints
GET /health--- health checkWS /ws--- WebSocket endpoint for pairing handshakes
Rate limiting
OTC (one-time code) endpoints are rate-limited to 5 failed attempts per IP per minute.
Programmatic usage
import { createRelay } from '@authmesh/relay';
const server = await createRelay({ host: '0.0.0.0', port: 3001 });