shogun-core 1.8.7 → 1.8.8
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.
|
@@ -9,14 +9,14 @@ exports.productionRelayExample = productionRelayExample;
|
|
|
9
9
|
exports.customRelayExample = customRelayExample;
|
|
10
10
|
exports.multipleRelaysExample = multipleRelaysExample;
|
|
11
11
|
exports.runExamples = runExamples;
|
|
12
|
-
const
|
|
12
|
+
const src_1 = require("../src/");
|
|
13
13
|
/**
|
|
14
14
|
* Basic relay server example
|
|
15
15
|
*/
|
|
16
16
|
async function basicRelayExample() {
|
|
17
17
|
console.log("Starting basic relay server...");
|
|
18
18
|
// Create a basic relay server
|
|
19
|
-
const relay =
|
|
19
|
+
const relay = (0, src_1.createRelay)({
|
|
20
20
|
port: 8765,
|
|
21
21
|
host: "localhost",
|
|
22
22
|
super: false,
|
|
@@ -44,7 +44,7 @@ async function basicRelayExample() {
|
|
|
44
44
|
async function productionRelayExample() {
|
|
45
45
|
console.log("Starting production relay server...");
|
|
46
46
|
// Create a production relay server using presets
|
|
47
|
-
const relay = (0,
|
|
47
|
+
const relay = (0, src_1.createRelay)(src_1.RelayPresets.production);
|
|
48
48
|
try {
|
|
49
49
|
await relay.start();
|
|
50
50
|
console.log(`Production relay server started at: ${relay.getRelayUrl()}`);
|
|
@@ -68,7 +68,7 @@ async function productionRelayExample() {
|
|
|
68
68
|
*/
|
|
69
69
|
async function customRelayExample() {
|
|
70
70
|
console.log("Starting custom relay server with WebSocket...");
|
|
71
|
-
const relay =
|
|
71
|
+
const relay = (0, src_1.createRelay)({
|
|
72
72
|
port: 8766,
|
|
73
73
|
host: "0.0.0.0",
|
|
74
74
|
super: true,
|
|
@@ -111,7 +111,7 @@ async function multipleRelaysExample() {
|
|
|
111
111
|
const relays = [];
|
|
112
112
|
// Create multiple relay servers on different ports
|
|
113
113
|
for (let i = 0; i < 3; i++) {
|
|
114
|
-
const relay =
|
|
114
|
+
const relay = (0, src_1.createRelay)({
|
|
115
115
|
port: 8765 + i,
|
|
116
116
|
host: "localhost",
|
|
117
117
|
super: i === 0, // First relay is super peer
|