-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_shello_with_proxy.ps1
More file actions
40 lines (35 loc) · 1.52 KB
/
Copy pathrun_shello_with_proxy.ps1
File metadata and controls
40 lines (35 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# run_shello_with_proxy.ps1
# Set up mitmproxy settings and execute Shello CLI.
# 1. Start mitmweb in the background if it's not already running
$mitmwebProcess = Get-Process -Name mitmweb -ErrorAction SilentlyContinue
if (-not $mitmwebProcess) {
Write-Host "🚀 Starting mitmweb (Web-based Proxy GUI)..." -ForegroundColor Cyan
# Start mitmweb minimized
Start-Process -FilePath "mitmweb" -WindowStyle Minimized
# Wait for mitmweb to bind to ports
Start-Sleep -Seconds 2
} else {
Write-Host "✅ mitmweb is already running." -ForegroundColor Green
}
Write-Host "🌐 mitmweb UI is available at: http://127.0.0.1:8123" -ForegroundColor Green
# 2. Configure Environment Variables for Python/HTTP proxy
$env:HTTP_PROXY = "http://127.0.0.1:8080"
$env:HTTPS_PROXY = "http://127.0.0.1:8080"
# 3. Path to mitmproxy CA Certificate
$caCertPath = "$env:USERPROFILE\.mitmproxy\mitmproxy-ca-cert.pem"
if (Test-Path $caCertPath) {
$env:REQUESTS_CA_BUNDLE = $caCertPath
$env:SSL_CERT_FILE = $caCertPath
Write-Host "🔒 Certificate configured correctly for SSL interception." -ForegroundColor Green
} else {
Write-Warning "⚠️ mitmproxy CA certificate not found at $caCertPath."
Write-Warning "You might get SSL errors. Run 'mitmweb' once to generate it."
}
# 4. Run Shello CLI
Write-Host "▶ Running Shello CLI with proxy configuration..." -ForegroundColor Yellow
if ($args.Count -eq 0) {
# Default to chat subcommand if no args passed
& .venv\Scripts\shello chat
} else {
& .venv\Scripts\shello $args
}