peerpigeon 0.1.1 โ 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -1365
- package/cli.js +1382 -0
- package/dist/peerpigeon-browser.js +12290 -0
- package/dist/peerpigeon-browser.js.map +7 -0
- package/docs/API_DOCUMENTATION.md +1945 -0
- package/docs/BOOTSTRAP_HUBS.md +319 -0
- package/docs/CLI_README.md +371 -0
- package/docs/DOCUMENTATION_REORGANIZATION.md +172 -0
- package/docs/HUB_QUICK_REF.md +107 -0
- package/docs/HUB_SCRIPTS.md +331 -0
- package/docs/HUB_SYSTEM.md +552 -0
- package/docs/MIGRATION_COMPLETE.md +93 -0
- package/docs/NETWORK_NAMESPACES.md +212 -0
- package/docs/README.md +107 -0
- package/docs/SELECTIVE_STREAMING_GUIDE.md +427 -0
- package/docs/TEST_CLEANUP_COMPLETE.md +80 -0
- package/examples/bootstrap-hub-example.js +292 -0
- package/examples/browser/README.md +278 -0
- package/examples/browser/app.js +2426 -49
- package/examples/browser/index.html +481 -630
- package/examples/browser/minimal/README.md +55 -0
- package/examples/browser/minimal/index.html +75 -0
- package/examples/browser/minimal/minimal.js +234 -0
- package/examples/browser/styles.css +687 -1425
- package/examples/browser/test-bundle.html +35 -0
- package/examples/browser-2/index.html +30 -0
- package/examples/browser-2/package.json +21 -0
- package/examples/browser-2/src/App-simple.vue +21 -0
- package/examples/browser-2/src/App.vue +420 -0
- package/examples/browser-2/src/components/CryptoView.vue +1661 -0
- package/examples/browser-2/src/components/DHTView.vue +1281 -0
- package/examples/browser-2/src/components/DebugView.vue +1773 -0
- package/examples/browser-2/src/components/MediaView.vue +1048 -0
- package/examples/browser-2/src/components/MessagingView.vue +775 -0
- package/examples/browser-2/src/components/NetworkView.vue +930 -0
- package/examples/browser-2/src/components/StorageView.vue +1376 -0
- package/examples/browser-2/src/main.js +5 -0
- package/examples/browser-2/src/stores/peerpigeon.js +895 -0
- package/examples/browser-2/vite.config.js +6 -0
- package/examples/hub-example.js +186 -0
- package/examples/multi-hub-test.js +186 -0
- package/examples/node/README.md +2 -2
- package/examples/selective-streaming-demo.html +698 -0
- package/examples/standard-events-demo.js +126 -0
- package/package.json +33 -16
- package/server/index.js +1032 -98
- package/server/start.js +49 -0
- package/src/ConnectionManager.js +239 -225
- package/src/CryptoManager.js +147 -18
- package/src/DebugLogger.js +0 -7
- package/src/DistributedStorageManager.js +224 -205
- package/src/EnvironmentDetector.js +109 -2
- package/src/EventEmitter.js +79 -1
- package/src/EvictionManager.js +10 -9
- package/src/GossipManager.js +163 -11
- package/src/PeerConnection.js +333 -310
- package/src/PeerPigeonMesh.js +577 -135
- package/src/SignalingClient.js +14 -243
- package/src/SignalingHandler.js +31 -10
- package/src/StorageManager.js +0 -39
- package/src/WebDHT-Simple.js +389 -0
- package/src/WebDHT.js +363 -1165
- package/src/browser-entry.js +40 -0
- package/examples/browser/assets/images/favicon.png +0 -0
- package/examples/browser/assets/images/pigeon.png +0 -0
- package/examples/browser/crypto-test.html +0 -427
- package/examples/browser/ui-old.js +0 -1926
- package/examples/browser/ui.js +0 -3391
- package/websocket-server/README.md +0 -247
- package/websocket-server/server.js +0 -391
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PeerPigeon Hub Example
|
|
3
|
+
*
|
|
4
|
+
* This example demonstrates how to set up and use PeerPigeon hubs.
|
|
5
|
+
* Hubs are long-standing servers that:
|
|
6
|
+
* 1. Connect to each other on the 'pigeonhub-mesh' namespace
|
|
7
|
+
* 2. Still serve regular peers in their own networks
|
|
8
|
+
* 3. Can be identified and tracked separately from regular peers
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { PeerPigeonServer } from '../server/index.js';
|
|
12
|
+
|
|
13
|
+
// Example 1: Create a regular signaling server
|
|
14
|
+
async function createRegularServer() {
|
|
15
|
+
const server = new PeerPigeonServer({
|
|
16
|
+
port: 3000,
|
|
17
|
+
host: 'localhost',
|
|
18
|
+
isHub: false // Regular server
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
server.on('peerConnected', ({ peerId, totalConnections }) => {
|
|
22
|
+
console.log(`Peer connected: ${peerId.substring(0, 8)}... (Total: ${totalConnections})`);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
server.on('peerAnnounced', ({ peerId, networkName, isHub }) => {
|
|
26
|
+
if (isHub) {
|
|
27
|
+
console.log(`๐ข Hub announced: ${peerId.substring(0, 8)}... on network: ${networkName}`);
|
|
28
|
+
} else {
|
|
29
|
+
console.log(`๐ฑ Peer announced: ${peerId.substring(0, 8)}... on network: ${networkName}`);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
server.on('peerDisconnected', ({ peerId, totalConnections }) => {
|
|
34
|
+
console.log(`Peer disconnected: ${peerId.substring(0, 8)}... (Remaining: ${totalConnections})`);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
await server.start();
|
|
38
|
+
console.log('Regular server started');
|
|
39
|
+
return server;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Example 2: Create a hub server
|
|
43
|
+
async function createHubServer() {
|
|
44
|
+
const hubServer = new PeerPigeonServer({
|
|
45
|
+
port: 3001,
|
|
46
|
+
host: 'localhost',
|
|
47
|
+
isHub: true // This is a hub server
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Listen for hub registration events
|
|
51
|
+
hubServer.on('hubRegistered', ({ peerId, totalHubs }) => {
|
|
52
|
+
console.log(`๐ข New hub registered: ${peerId.substring(0, 8)}... (Total hubs: ${totalHubs})`);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
hubServer.on('hubUnregistered', ({ peerId, totalHubs }) => {
|
|
56
|
+
console.log(`๐ข Hub unregistered: ${peerId.substring(0, 8)}... (Remaining hubs: ${totalHubs})`);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
hubServer.on('peerAnnounced', ({ peerId, networkName, isHub }) => {
|
|
60
|
+
if (isHub) {
|
|
61
|
+
console.log(`๐ข Hub peer announced: ${peerId.substring(0, 8)}... on network: ${networkName}`);
|
|
62
|
+
} else {
|
|
63
|
+
console.log(`๐ฑ Regular peer announced: ${peerId.substring(0, 8)}... on network: ${networkName}`);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
await hubServer.start();
|
|
68
|
+
console.log('Hub server started');
|
|
69
|
+
return hubServer;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Example 3: Get hub statistics
|
|
73
|
+
async function displayHubStats(server) {
|
|
74
|
+
const stats = server.getStats();
|
|
75
|
+
const hubStats = server.getHubStats();
|
|
76
|
+
|
|
77
|
+
console.log('\n๐ Server Statistics:');
|
|
78
|
+
console.log(` Is Hub Server: ${stats.isHub}`);
|
|
79
|
+
console.log(` Total Connections: ${stats.connections}`);
|
|
80
|
+
console.log(` Total Peers: ${stats.peers}`);
|
|
81
|
+
console.log(` Total Hubs: ${stats.hubs}`);
|
|
82
|
+
console.log(` Networks: ${stats.networks}`);
|
|
83
|
+
console.log(` Uptime: ${Math.floor(stats.uptime / 1000)}s`);
|
|
84
|
+
|
|
85
|
+
console.log('\n๐ข Hub Statistics:');
|
|
86
|
+
console.log(` Total Hubs: ${hubStats.totalHubs}`);
|
|
87
|
+
console.log(` Connected Hubs: ${hubStats.connectedHubs}`);
|
|
88
|
+
|
|
89
|
+
if (hubStats.hubs.length > 0) {
|
|
90
|
+
console.log(' Hub List:');
|
|
91
|
+
hubStats.hubs.forEach(hub => {
|
|
92
|
+
console.log(` - ${hub.peerId.substring(0, 8)}... (network: ${hub.networkName})`);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Example 4: Client-side hub announcement
|
|
98
|
+
function clientAnnounceAsHub() {
|
|
99
|
+
// When a client connects to the signaling server and wants to identify as a hub:
|
|
100
|
+
const announceMessage = {
|
|
101
|
+
type: 'announce',
|
|
102
|
+
networkName: 'pigeonhub-mesh', // Special namespace for hubs
|
|
103
|
+
data: {
|
|
104
|
+
isHub: true, // Identify as a hub
|
|
105
|
+
// Add any additional hub metadata
|
|
106
|
+
hubVersion: '1.0.0',
|
|
107
|
+
capabilities: ['signaling', 'relay', 'storage']
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// Send this message via WebSocket
|
|
112
|
+
// ws.send(JSON.stringify(announceMessage));
|
|
113
|
+
|
|
114
|
+
console.log('Hub announcement message:', announceMessage);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Example 5: Client-side regular peer announcement
|
|
118
|
+
function clientAnnounceAsPeer() {
|
|
119
|
+
// When a regular peer connects:
|
|
120
|
+
const announceMessage = {
|
|
121
|
+
type: 'announce',
|
|
122
|
+
networkName: 'my-app-network', // Regular application network
|
|
123
|
+
data: {
|
|
124
|
+
isHub: false, // Or omit this field
|
|
125
|
+
// Add any peer metadata
|
|
126
|
+
peerType: 'browser',
|
|
127
|
+
capabilities: ['messaging', 'video']
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// Send this message via WebSocket
|
|
132
|
+
// ws.send(JSON.stringify(announceMessage));
|
|
133
|
+
|
|
134
|
+
console.log('Peer announcement message:', announceMessage);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Example 6: Discover other hubs
|
|
138
|
+
function discoverOtherHubs() {
|
|
139
|
+
// When a hub announces on 'pigeonhub-mesh', it will receive notifications about other hubs
|
|
140
|
+
// Listen for 'peer-discovered' messages where isHub === true
|
|
141
|
+
|
|
142
|
+
console.log(`
|
|
143
|
+
When a hub connects to the signaling server and announces on 'pigeonhub-mesh':
|
|
144
|
+
1. It will receive a list of all other hubs already on that network
|
|
145
|
+
2. All other hubs will be notified about this new hub
|
|
146
|
+
3. The server tracks all hubs separately from regular peers
|
|
147
|
+
4. Hubs can then establish WebRTC connections to each other
|
|
148
|
+
`);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Main execution
|
|
152
|
+
async function main() {
|
|
153
|
+
console.log('=== PeerPigeon Hub Example ===\n');
|
|
154
|
+
|
|
155
|
+
// Create servers
|
|
156
|
+
console.log('Creating servers...\n');
|
|
157
|
+
const regularServer = await createRegularServer();
|
|
158
|
+
const hubServer = await createHubServer();
|
|
159
|
+
|
|
160
|
+
// Display stats after a moment
|
|
161
|
+
setTimeout(async () => {
|
|
162
|
+
console.log('\n--- Regular Server Stats ---');
|
|
163
|
+
await displayHubStats(regularServer);
|
|
164
|
+
|
|
165
|
+
console.log('\n--- Hub Server Stats ---');
|
|
166
|
+
await displayHubStats(hubServer);
|
|
167
|
+
|
|
168
|
+
console.log('\n--- Client Examples ---');
|
|
169
|
+
clientAnnounceAsHub();
|
|
170
|
+
clientAnnounceAsPeer();
|
|
171
|
+
discoverOtherHubs();
|
|
172
|
+
|
|
173
|
+
// Cleanup
|
|
174
|
+
console.log('\n\nShutting down servers...');
|
|
175
|
+
await regularServer.stop();
|
|
176
|
+
await hubServer.stop();
|
|
177
|
+
console.log('Done!');
|
|
178
|
+
}, 2000);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Run if this is the main module
|
|
182
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
183
|
+
main().catch(console.error);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { createRegularServer, createHubServer, displayHubStats };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Multi-Hub Cross-Peer Connection Test
|
|
5
|
+
*
|
|
6
|
+
* This example demonstrates:
|
|
7
|
+
* 1. Starting multiple hubs (Hub A on 3000, Hub B on 3001)
|
|
8
|
+
* 2. Hub B connects to Hub A as bootstrap
|
|
9
|
+
* 3. Peers connect to different hubs
|
|
10
|
+
* 4. Peers discover each other across hubs
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* node examples/multi-hub-test.js
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { PeerPigeonServer } from '../server/index.js';
|
|
17
|
+
import { PeerPigeonMesh } from '../index.js';
|
|
18
|
+
|
|
19
|
+
// Setup WebRTC for Node.js
|
|
20
|
+
async function setupWebRTC() {
|
|
21
|
+
try {
|
|
22
|
+
const [WebSocket, wrtc] = await Promise.all([
|
|
23
|
+
import('ws'),
|
|
24
|
+
import('@koush/wrtc')
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
global.RTCPeerConnection = wrtc.default.RTCPeerConnection;
|
|
28
|
+
global.RTCSessionDescription = wrtc.default.RTCSessionDescription;
|
|
29
|
+
global.RTCIceCandidate = wrtc.default.RTCIceCandidate;
|
|
30
|
+
global.WebSocket = WebSocket.default;
|
|
31
|
+
|
|
32
|
+
return true;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error('โ Failed to setup WebRTC:', error);
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function main() {
|
|
40
|
+
console.log('๐ Multi-Hub Cross-Peer Connection Test\n');
|
|
41
|
+
|
|
42
|
+
// Initialize WebRTC
|
|
43
|
+
if (!await setupWebRTC()) {
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Start Hub A (Bootstrap Hub on port 3000)
|
|
48
|
+
console.log('๐ก Starting Hub A (Bootstrap) on port 3000...');
|
|
49
|
+
const hubA = new PeerPigeonServer({
|
|
50
|
+
port: 3000,
|
|
51
|
+
host: 'localhost',
|
|
52
|
+
isHub: true,
|
|
53
|
+
autoConnect: false // This is the bootstrap hub, no need to connect
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
await hubA.start();
|
|
57
|
+
console.log('โ
Hub A running\n');
|
|
58
|
+
|
|
59
|
+
// Wait a moment
|
|
60
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
61
|
+
|
|
62
|
+
// Start Hub B (connects to Hub A on port 3000)
|
|
63
|
+
console.log('๐ก Starting Hub B on port 3001 (bootstrapping to Hub A)...');
|
|
64
|
+
const hubB = new PeerPigeonServer({
|
|
65
|
+
port: 3001,
|
|
66
|
+
host: 'localhost',
|
|
67
|
+
isHub: true,
|
|
68
|
+
bootstrapHubs: ['ws://localhost:3000'], // Connect to Hub A
|
|
69
|
+
autoConnect: true
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
await hubB.start();
|
|
73
|
+
console.log('โ
Hub B running\n');
|
|
74
|
+
|
|
75
|
+
// Wait for hub connection to establish
|
|
76
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
77
|
+
|
|
78
|
+
// Create Peer 1 connected to Hub A
|
|
79
|
+
console.log('๐ค Creating Peer 1 (connected to Hub A on port 3000)...');
|
|
80
|
+
const peer1 = new PeerPigeonMesh({
|
|
81
|
+
networkName: 'test-network',
|
|
82
|
+
ignoreEnvironmentErrors: true
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
let peer1Discovered = false;
|
|
86
|
+
let peer2Discovered = false;
|
|
87
|
+
|
|
88
|
+
peer1.on('peer-discovered', ({ peerId }) => {
|
|
89
|
+
console.log(`โ
Peer 1 DISCOVERED EVENT: ${peerId.substring(0, 8)}...`);
|
|
90
|
+
peer2Discovered = true;
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
peer1.on('peerDiscovered', ({ peerId }) => {
|
|
94
|
+
console.log(`โ
Peer 1 peerDiscovered EVENT: ${peerId.substring(0, 8)}...`);
|
|
95
|
+
peer2Discovered = true;
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
peer1.on('peer-connected', ({ peerId }) => {
|
|
99
|
+
console.log(`๐ค Peer 1 CONNECTED to peer: ${peerId.substring(0, 8)}...`);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
peer1.on('peerConnected', ({ peerId }) => {
|
|
103
|
+
console.log(`๐ค Peer 1 peerConnected to peer: ${peerId.substring(0, 8)}...`);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
await peer1.init();
|
|
107
|
+
await peer1.connect('ws://localhost:3000');
|
|
108
|
+
console.log(`โ
Peer 1 connected (ID: ${peer1.peerId.substring(0, 8)}...)\n`);
|
|
109
|
+
|
|
110
|
+
// Wait a moment
|
|
111
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
112
|
+
|
|
113
|
+
// Create Peer 2 connected to Hub B
|
|
114
|
+
console.log('๐ค Creating Peer 2 (connected to Hub B on port 3001)...');
|
|
115
|
+
const peer2 = new PeerPigeonMesh({
|
|
116
|
+
networkName: 'test-network',
|
|
117
|
+
ignoreEnvironmentErrors: true
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
peer2.on('peer-discovered', ({ peerId }) => {
|
|
121
|
+
console.log(`โ
Peer 2 DISCOVERED EVENT: ${peerId.substring(0, 8)}...`);
|
|
122
|
+
peer1Discovered = true;
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
peer2.on('peerDiscovered', ({ peerId }) => {
|
|
126
|
+
console.log(`โ
Peer 2 peerDiscovered EVENT: ${peerId.substring(0, 8)}...`);
|
|
127
|
+
peer1Discovered = true;
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
peer2.on('peer-connected', ({ peerId }) => {
|
|
131
|
+
console.log(`๐ค Peer 2 CONNECTED to peer: ${peerId.substring(0, 8)}...`);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
peer2.on('peerConnected', ({ peerId }) => {
|
|
135
|
+
console.log(`๐ค Peer 2 peerConnected to peer: ${peerId.substring(0, 8)}...`);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
await peer2.init();
|
|
139
|
+
await peer2.connect('ws://localhost:3001');
|
|
140
|
+
console.log(`โ
Peer 2 connected (ID: ${peer2.peerId.substring(0, 8)}...)\n`);
|
|
141
|
+
|
|
142
|
+
// Wait for peer discovery
|
|
143
|
+
console.log('โณ Waiting for cross-hub peer discovery...');
|
|
144
|
+
|
|
145
|
+
// Wait up to 10 seconds for discovery
|
|
146
|
+
const startTime = Date.now();
|
|
147
|
+
const timeout = 10000;
|
|
148
|
+
|
|
149
|
+
while (!peer1Discovered || !peer2Discovered) {
|
|
150
|
+
if (Date.now() - startTime > timeout) {
|
|
151
|
+
console.error('โ Timeout waiting for peer discovery!');
|
|
152
|
+
console.error(` Peer 1 discovered Peer 2: ${peer1Discovered}`);
|
|
153
|
+
console.error(` Peer 2 discovered Peer 1: ${peer2Discovered}`);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (peer1Discovered && peer2Discovered) {
|
|
160
|
+
console.log('\nโ
SUCCESS! Peers on different hubs discovered each other!');
|
|
161
|
+
} else {
|
|
162
|
+
console.log('\nโ FAILED! Peers did not discover each other.');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Show final status
|
|
166
|
+
console.log('\n๐ Final Status:');
|
|
167
|
+
console.log(` Hub A: ${hubA.connections.size} connections`);
|
|
168
|
+
console.log(` Hub B: ${hubB.connections.size} connections`);
|
|
169
|
+
console.log(` Peer 1 discovered peers: ${peer1.discoveredPeers.size}`);
|
|
170
|
+
console.log(` Peer 2 discovered peers: ${peer2.discoveredPeers.size}`);
|
|
171
|
+
|
|
172
|
+
// Cleanup
|
|
173
|
+
console.log('\n๐งน Cleaning up...');
|
|
174
|
+
await peer1.disconnect();
|
|
175
|
+
await peer2.disconnect();
|
|
176
|
+
await hubB.stop();
|
|
177
|
+
await hubA.stop();
|
|
178
|
+
|
|
179
|
+
console.log('โ
Test complete!');
|
|
180
|
+
process.exit(peer1Discovered && peer2Discovered ? 0 : 1);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
main().catch(error => {
|
|
184
|
+
console.error('โ Test failed:', error);
|
|
185
|
+
process.exit(1);
|
|
186
|
+
});
|
package/examples/node/README.md
CHANGED
|
@@ -101,8 +101,8 @@ Each example initializes a PeerPigeon mesh with the required features:
|
|
|
101
101
|
|
|
102
102
|
```javascript
|
|
103
103
|
const mesh = new PeerPigeonMesh({
|
|
104
|
-
enableWebDHT: true, // Distributed hash table
|
|
105
|
-
enableCrypto: true, // Encryption/decryption
|
|
104
|
+
enableWebDHT: true, // Distributed hash table (default: true)
|
|
105
|
+
enableCrypto: true, // Encryption/decryption (default: true)
|
|
106
106
|
enableDistributedStorage: true // Optional storage layer
|
|
107
107
|
});
|
|
108
108
|
```
|