Compare commits
No commits in common. "212edf184de7537005e12291d026caaf483c5028" and "9b9ff2118cef7e090703875bfa4c6236b2665ed9" have entirely different histories.
212edf184d
...
9b9ff2118c
|
@ -9,12 +9,16 @@ let app: FastifyInstance;
|
||||||
export async function start() {
|
export async function start() {
|
||||||
const keyPair = getKeyPair();
|
const keyPair = getKeyPair();
|
||||||
app = fastify({
|
app = fastify({
|
||||||
logger: log.child({ module: "app-server" }),
|
logger: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await app.listen({ port: 80, host: "0.0.0.0" });
|
||||||
|
|
||||||
app.get("/", (req, res) => {
|
app.get("/", (req, res) => {
|
||||||
res.send(Buffer.from(keyPair.publicKey).toString("hex"));
|
res.send(Buffer.from(keyPair.publicKey).toString("hex"));
|
||||||
});
|
});
|
||||||
|
|
||||||
await app.listen({ port: 80, host: "0.0.0.0" });
|
const address = app.server.address() as AddressInfo;
|
||||||
|
|
||||||
|
log.info("HTTP/App Server started on ", `${address.address}:${address.port}`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import * as http2 from "http2";
|
||||||
import websocket from "@fastify/websocket";
|
import websocket from "@fastify/websocket";
|
||||||
|
|
||||||
export async function start() {
|
export async function start() {
|
||||||
|
const relayPort = config.uint("port");
|
||||||
const dht = getSwarm();
|
const dht = getSwarm();
|
||||||
let sslOptions: boolean | http2.SecureServerOptions = false;
|
let sslOptions: boolean | http2.SecureServerOptions = false;
|
||||||
|
|
||||||
|
@ -29,7 +30,6 @@ export async function start() {
|
||||||
let relayServer = fastify({
|
let relayServer = fastify({
|
||||||
http2: true,
|
http2: true,
|
||||||
https: sslOptions as http2.SecureServerOptions,
|
https: sslOptions as http2.SecureServerOptions,
|
||||||
logger: log.child({ module: "relay-server" }),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
relayServer.register(websocket);
|
relayServer.register(websocket);
|
||||||
|
@ -39,4 +39,9 @@ export async function start() {
|
||||||
});
|
});
|
||||||
|
|
||||||
await relayServer.listen({ port: config.uint("port"), host: "0.0.0.0" });
|
await relayServer.listen({ port: config.uint("port"), host: "0.0.0.0" });
|
||||||
|
let address = relayServer.server.address() as AddressInfo;
|
||||||
|
log.info(
|
||||||
|
"DHT Relay Server started on ",
|
||||||
|
`${address.address}:${address.port}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,8 @@ export async function start() {
|
||||||
node.join(LUMEWEB_TOPIC_HASH);
|
node.join(LUMEWEB_TOPIC_HASH);
|
||||||
|
|
||||||
log.info(
|
log.info(
|
||||||
"Relay Identity is %s",
|
"Relay Identity is",
|
||||||
b4a.from(getKeyPair().publicKey).toString("hex")
|
b4a.from(node.dht.defaultKeyPair.publicKey).toString("hex")
|
||||||
);
|
);
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
|
|
|
@ -616,9 +616,9 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@lumeweb/cfg@https://git.lumeweb.com/LumeWeb/cfg.git#commit=e11e94c61c92ae7b0eeabd43bc65176de75084fb":
|
"@lumeweb/cfg@https://git.lumeweb.com/LumeWeb/cfg.git#commit=f69a12fb52c757fac5ce7287f58c13120af69ad2":
|
||||||
version: 0.1.7
|
version: 0.1.7
|
||||||
resolution: "@lumeweb/cfg@https://git.lumeweb.com/LumeWeb/cfg.git#commit=e11e94c61c92ae7b0eeabd43bc65176de75084fb"
|
resolution: "@lumeweb/cfg@https://git.lumeweb.com/LumeWeb/cfg.git#commit=f69a12fb52c757fac5ce7287f58c13120af69ad2"
|
||||||
dependencies:
|
dependencies:
|
||||||
arg: "npm:^5.0.2"
|
arg: "npm:^5.0.2"
|
||||||
bsert: "npm:~0.0.10"
|
bsert: "npm:~0.0.10"
|
||||||
|
|
Loading…
Reference in New Issue