Browse Source

Update ws paths

Owen 4 months ago
parent
commit
ef69bf9256
2 changed files with 4 additions and 4 deletions
  1. 2 2
      server/routers/newt/handleGetConfigMessage.ts
  2. 2 2
      server/routers/newt/peers.ts

+ 2 - 2
server/routers/newt/handleGetConfigMessage.ts

@@ -92,7 +92,7 @@ export const handleGetConfigMessage: MessageHandler = async (context) => {
         clientsRes.map(async (client) => {
             return {
                 publicKey: client.pubKey,
-                allowedIps: "0.0.0.0/0"
+                allowedIps: "0.0.0.0/0" // TODO: We should lock this down more
             };
         })
     );
@@ -107,7 +107,7 @@ export const handleGetConfigMessage: MessageHandler = async (context) => {
 
     return {
         message: {
-            type: "newt/wg/connect", // what to make the response type?
+            type: "newt/wg/receive-config", // what to make the response type?
             data: {
                 config: configResponse
             }

+ 2 - 2
server/routers/newt/peers.ts

@@ -20,7 +20,7 @@ export async function addPeer(siteId: number, peer: {
     }
 
     sendToClient(newt.newtId, {
-        type: 'add_peer',    
+        type: 'newt/wg/peer/add',    
         data: peer
     });
 }
@@ -38,7 +38,7 @@ export async function deletePeer(siteId: number, publicKey: string) {
     }
 
     sendToClient(newt.newtId, {
-        type: 'delete_peer',
+        type: 'newt/wg/peer/remove',
         data: {
             publicKey
         }