Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ataraxia-tcp

TCP-based transport for Network, can discover and automatically establish encrypted connections over TCP.

Supports pluggable discoveries via TCPPeerDiscovery with a mDNS implementation in TCPPeerMDNSDiscovery that discover peers on the same local network.

import { Network, AnonymousAuth } from 'ataraxia';
import { TCPTransport, TCPPeerMDNSDiscovery } from 'ataraxia-tcp';

// Setup a network with anonymous authentication
const net = new Network({
name: 'name-of-your-app-or-network',
transports: [
new TCPTransport({
// Discover other peers on the same physical network
discovery: new TCPPeerMDNSDiscovery(),
// Use anonymous authentication
authentication: [
new AnonymousAuth()
]
})
]
});

// Start the network
await net.start();

Index

Generated using TypeDoc