feat(electron): add http routers to electron

This commit is contained in:
Esteban Abaroa
2024-11-19 18:58:24 +00:00
parent 420bc36084
commit 521d26bbe3
6 changed files with 81 additions and 104 deletions
+2 -2
View File
@@ -15,8 +15,7 @@ const defaultPlebbitOptions = {
// find the user's OS data path
dataPath: !isDev ? envPaths.data : path.join(dirname, '..', '.plebbit'),
ipfsHttpClientsOptions: ['http://localhost:5001/api/v0'],
// TODO: having to define pubsubHttpClientsOptions and ipfsHttpClientsOptions is a bug with plebbit-js
pubsubHttpClientsOptions: ['http://localhost:5001/api/v0'],
httpRoutersOptions: ['https://routing.lol', 'https://peers.pleb.bot'],
};
// generate plebbit rpc auth key if doesn't exist
@@ -42,6 +41,7 @@ const start = async () => {
return;
}
const plebbitWebSocketServer = await PlebbitRpc.PlebbitWsServer({ port, plebbitOptions: defaultPlebbitOptions, authKey: plebbitRpcAuthKey });
plebbitWebSocketServer.on('error', (e) => console.log('plebbit rpc error', e));
console.log(`plebbit rpc: listening on ws://localhost:${port} (local connections only)`);
console.log(`plebbit rpc: listening on ws://localhost:${port}/${plebbitRpcAuthKey} (secret auth key for remote connections)`);