diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index cd496f2..521a9bc 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -411,7 +411,9 @@ const routes = async (fastifyInstance: FastifyInstance) => { const connection = currentConnections[workerId]; const isAllocated = !unallocatedConnections.includes(workerId); - const deviceId = Object.keys(controlConnections).find((deviceId) => workerId.startsWith(deviceId)); + const deviceId = + connection.mitm?.deviceId ?? + Object.keys(controlConnections).find((deviceId) => workerId.startsWith(deviceId)); return { deviceId,