How to deploy a http proxy with docker

Recently, I need a lot of proxy ip to run python crawler. It is easy for me to obtain multiple ip, so I just to mwan3 of openwrt to allocate these ip to my local network ip. Therefore I need to deploy proxy software for my python using.

Deploy

1
docker run -d --name tinyproxy-41 --network bridge-host --ip=192.168.5.41 --restart always stilleshan/tinyproxy

Usage

1
2
3
4
5
6
7
8
9
10
import requests
proxy_41 = {
"http": "http://192.168.5.41:8888/",
"https": "http://192.168.5.41:8888/"
}
session = requests.session()
response = self.session.get(
'https://baidu.com',
timeout=60,
proxies=proxy_dict)

Reference

  1. https://www.ioiox.com/archives/130.html