Files
nas-tools/setup_mac_proxy_bridge.sh
T

41 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Setup Mac as Proxy Bridge for iPhone
# This script sets up a local proxy on Mac that tunnels to server2
echo "=== Mac Proxy Bridge Setup ==="
echo ""
# Check if Python is available (for simple HTTP proxy)
if command -v python3 &> /dev/null; then
echo "Python3 found - creating simple proxy bridge..."
echo ""
echo "Run this command to start the bridge:"
echo ""
echo "python3 -m http.server 8080 &"
echo "ssh -L 7890:127.0.0.1:7890 -N server2 &"
echo ""
echo "But we need a proper HTTP proxy, not just a web server..."
fi
# Better: Use socat or create a proper proxy
if command -v socat &> /dev/null; then
echo "socat found - can create proxy bridge"
echo ""
echo "Run:"
echo "ssh -L 7890:127.0.0.1:7890 -N server2 &"
echo "socat TCP-LISTEN:8080,fork,reuseaddr TCP:127.0.0.1:7890 &"
else
echo "Installing socat for proxy bridging..."
echo "brew install socat"
fi
echo ""
echo "=== Alternative: Use SSH Dynamic Port Forwarding ==="
echo ""
echo "Run this on your Mac:"
echo "ssh -D 1080 -N server2"
echo ""
echo "This creates a SOCKS5 proxy on localhost:1080"
echo "But iPhone HTTP Proxy doesn't support SOCKS5 directly..."