Merge pull request 'fix: running on windows' (#1) from Cyber/peartainer:main into main

Reviewed-on: snxraven/peartainer#1
This commit is contained in:
snxraven 2024-11-28 12:43:50 -05:00
commit 4753207c02

View File

@ -4,8 +4,9 @@ import Hyperswarm from 'hyperswarm';
import Docker from 'dockerode';
import crypto from 'hypercore-crypto';
import { PassThrough } from 'stream';
import os from "os";
const docker = new Docker({ socketPath: '/var/run/docker.sock' });
const docker = new Docker({ socketPath: os.platform() === "win32" ? '//./pipe/dockerDesktopLinuxEngine' : '/var/run/docker.sock' });
const swarm = new Hyperswarm();
const connectedPeers = new Set();
const terminalSessions = new Map(); // Map to track terminal sessions per peer
@ -427,4 +428,4 @@ process.on('SIGINT', () => {
console.log('[INFO] Server shutting down');
swarm.destroy();
process.exit();
});
});