How to Setup Lightweight HTTP Proxy Server using on EC2

How to Setup Lightweight HTTP Proxy Server using on EC2

Takahiro Iwasa
Takahiro Iwasa
1 min read
EC2 Python, a lightweight HTTP proxy server, can be used on EC2 instances to access internal websites and APIs.


Install with the following command.

pip install


Launch with the following command. After launching, you can view access logs in the terminal.

proxy --port 8080
pid:3330 [I] plugins.load:85 - Loaded plugin proxy.http.proxy.HttpProxyPlugin
pid:3330 [I] tcp.listen:82 - Listening on
pid:3330 [I] pool.setup:108 - Started 1 acceptors in threaded mode

If you want to keep running the proxy after terminating the SSH session, use the following command instead.

nohup proxy --port 8080 > /dev/null &


Establish an SSH tunnel with the following command.

ssh -L 8080:localhost:8080 -i .ssh/YOUR_PRIVATE_KEY ec2-user@YOUR_HOST

Try accessing Google through the proxy server with the following command.

curl -x http://localhost:8080
Takahiro Iwasa

Takahiro Iwasa

Software Developer at KAKEHASHI Inc.
Involved in the requirements definition, design, and development of cloud-native applications using AWS. Now, building a new prescription data collection platform at KAKEHASHI Inc. Japan AWS Top Engineers 2020-2023.