Fix MITM on window
This commit is contained in:
16
src/mitm/paths.js
Normal file
16
src/mitm/paths.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const path = require("path");
|
||||
const os = require("os");
|
||||
|
||||
// Single source of truth for data directory — matches localDb.js logic
|
||||
function getDataDir() {
|
||||
if (process.env.DATA_DIR) return process.env.DATA_DIR;
|
||||
if (process.platform === "win32") {
|
||||
return path.join(process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming"), "9router");
|
||||
}
|
||||
return path.join(os.homedir(), ".9router");
|
||||
}
|
||||
|
||||
const DATA_DIR = getDataDir();
|
||||
const MITM_DIR = path.join(DATA_DIR, "mitm");
|
||||
|
||||
module.exports = { DATA_DIR, MITM_DIR };
|
||||
Reference in New Issue
Block a user