region-proxy-1.2.3 is not a library.
region-proxy
A CLI tool to create a SOCKS proxy through AWS EC2 in any region.
Quick Start
# 1. Install
# 2. Set your default region (one-time setup)
# 3. Start the proxy
# 4. Verify your IP is now in Tokyo
# 5. Stop when done
That's it! After the initial setup, just run region-proxy start and region-proxy stop.
Features
- Multi-region support – Launch a proxy in any of 17 AWS regions
- One command setup – Automatically handles EC2 instance, security groups, and SSH keys
- Configurable defaults – Set default region, port, and other preferences
- Secure – Uses SSH dynamic port forwarding (SOCKS5 proxy)
- macOS integration – Automatically configures system-wide SOCKS proxy
- Clean shutdown – Automatically terminates EC2 instance and cleans up all AWS resources
- Cost-effective – Uses the smallest instance types (t4g.nano/t3.nano, ~$0.004/hour)
Prerequisites
- macOS
- AWS account with EC2 permissions
- AWS CLI configured (
aws configure)
Installation
Homebrew (Recommended)
From Source
Usage
Start a proxy
Check status
Stop the proxy
List available regions
Configuration
Cleanup orphaned resources
AWS Setup
Option 1: Terraform (Recommended)
# Configure AWS CLI with the created credentials
# Enter the access_key_id and secret_access_key from terraform output
Option 2: CloudFormation
# Wait for stack creation
# Get credentials
# Configure AWS CLI with the credentials
Option 3: Manual Setup
Create an IAM policy with the following permissions:
Then configure AWS CLI:
How it works
- Creates a minimal EC2 instance (t4g.nano) with Amazon Linux 2023
- Creates a temporary security group allowing SSH access
- Generates a temporary SSH key pair
- Establishes an SSH tunnel with dynamic port forwarding
- Optionally configures macOS system proxy
When you stop the proxy, all resources are automatically cleaned up.
Troubleshooting
AuthFailure or credential errors
No region specified
Orphaned resources
License
MIT License - see LICENSE for details.