@authmesh/relay
v0.7.0
Published
WebSocket relay server for amesh device pairing handshakes
Downloads
174
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 via npx
# or
bun packages/relay/dist/start.js # from the monorepoEnvironment 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 { createRelayServer } from '@authmesh/relay';
const relay = createRelayServer({ host: '0.0.0.0', port: 3001 });
relay.start();