GithubHelp home page GithubHelp logo

lspahija / torchestrator Goto Github PK

View Code? Open in Web Editor NEW
43.0 5.0 8.0 79 KB

Spin up Tor containers and then proxy HTTP requests via these Tor instances

License: Apache License 2.0

Kotlin 90.04% Dockerfile 1.69% Shell 3.06% Python 5.21%
scraping scraping-websites scraping-tool data-scraping scraping-data kotlin tor docker proxy proxy-server proxy-list proxy-checker proxypool proxies proxies-generator proxies-https-traffic free-proxies proxy-scraper privoxy scrapy

torchestrator's Introduction

Torchestrator

Torchestrator can spin up Tor containers and expose ports for proxying HTTP requests via these Tor instances.

The IP address of the exit node of each Tor instance will vary. This is useful for IP address rotation.

To run:

  • set number of Tor containers you wish to spin up with config property tor.containerQuantity in torchestrator/src/main/resources/application.properties (default is 10, but can be a much higher number depending on RAM)
  • cd into torchestrator directory and execute ./gradlew bootRun (with JDK 15) or run in an IDE like IntelliJ IDEA
  • get next proxy port with GET localhost:8080/port

Examples

Scraping with Python using Torchestrator as a proxy provider:

import requests

torchestrator_host = "localhost"
tochestrator_port = 8080
torchestrator_api_path = "port"


def fetch_proxy_port():
    response = requests.get(f'http://{torchestrator_host}:{tochestrator_port}/{torchestrator_api_path}')
    return response.text


def get_using_proxy(url, proxy):
    return requests.get(url, proxies={"http": proxy, "https": proxy})


def scrape_using_proxy(url):
    proxy_port = fetch_proxy_port()
    response = get_using_proxy(url, f'{torchestrator_host}:{proxy_port}')
    print(response.text)
  
    
scrape_using_proxy("http://icanhazip.com/")

Similarly, a sample Kotlin HTTP client proxying requests via Tor instances can be found in torchestrator/src/main/kotlin/com/alealogic/torchestrator/client/ExampleClient.kt

Find this useful?

Please star this repository! It helps contributors gauge the popularity of the repo and determine how much time to allot to development.

torchestrator's People

Contributors

lspahija avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.