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