[add] MVP

This commit is contained in:
Pablo Aramburo 2022-09-16 15:35:23 -06:00
commit dc0f8dccaa
6 changed files with 44 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
venv/
proxies.txt

12
README.md Normal file
View File

@ -0,0 +1,12 @@
# Proxy
## Running the project
First create a list of live proxies
```bash
python3 scrape_proxies.py proxies.txt
```
Then run the mubeng instance through docker-compose
```bash
docker-compose up
```

11
docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: '3.7'
services:
mubeng:
image: kitabisa/mubeng:v0.10.0
container_name: mubeng
restart: always
ports:
- "8080:8080"
volumes:
- .:/mubeng
command: '--check --address 0.0.0.0:8080 --rotate 1 --method random --file /mubeng/proxies.txt --watch --timeout 10s'

6
example.py Normal file
View File

@ -0,0 +1,6 @@
import requests
proxies = {'https': 'http://localhost:8080', 'http': 'http://localhost:8080'}
ip = requests.get(url='http://canhasip.com/', proxies=proxies).text
print(ip)

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
requests==2.28.1

12
scrape_proxies.py Normal file
View File

@ -0,0 +1,12 @@
import requests
import json
r = requests.get('https://raw.githubusercontent.com/fate0/proxylist/master/proxy.list')
formated_proxies = []
for line in r.text.splitlines():
parsed = json.loads(line)
if bool(parsed['anonymity'] == 'high_anonymous'):
proxy_string = f'{parsed["type"]}://{parsed["host"]}:{parsed["port"]}'
print(proxy_string)