Skip to content

Commit 21f375b

Browse files
committed
Upstream proxy support
1 parent b7f2c0c commit 21f375b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

add_target.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ if (fs.existsSync('./targets.json')){
1414
config = JSON.parse(fs.readFileSync('./targets.json'))
1515
}
1616

17+
var cuddlephish_config = JSON.parse(fs.readFileSync('./config.json'))
1718
var captured_favicon = false;
1819
var desperate = false;
1920
var super_desperate = false;
@@ -26,6 +27,11 @@ var favicon_url = '';
2627
"--start-maximized",
2728
"--no-sandbox",
2829
]
30+
31+
if(cuddlephish_config.proxy !== undefined){
32+
puppet_options.push("--proxy-server=" + cuddlephish_config.proxy)
33+
}
34+
2935
const browser = await puppeteer.launch({
3036
headless: "new",
3137
ignoreHTTPSErrors: true,

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ async function get_browser(target_page){
256256
`--display=${xvfb._display}`
257257
]
258258

259+
if(config.proxy !== undefined){
260+
puppet_options.push("--proxy-server=" + config.proxy)
261+
}
259262
//set up a unique user data directory for this session so users don't stomp on each others' connections
260263
//we'll use this same ID to track unique browser instances for socket renegotiations etc. as well
261264
let browser_id = Math.random().toString(36).slice(2)

0 commit comments

Comments
 (0)