Skip to content

a lightweight, containerised Tor SOCKS5 proxy 🐳

Notifications You must be signed in to change notification settings

joshhighet/torsocc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

torsocc

torsocc is a minimal docker image exposing a SOCKS5 proxy for onion routing (tor) over tcp://9050

docker run -p9050:9050 ghcr.io/joshhighet/torsocc:latest

cloudflare have an onion-routable DNS over HTTPS endpoint available at dns4torpnlfs2ifuz2s2yf3fc7rdmsbhm6rw75euj35pac6ap25zgqad.onion

using this within github actions

see GitHub Actions Service Containers

jobs:
  torsocc-job:
    runs-on: ubuntu-latest
    services:
      torproxy:
        image: ghcr.io/joshhighet/torsocc:latest
        ports:
        - 9050:9050
    steps:
      - name: checkout the repo
        uses: actions/checkout@v2
      - name: hello-world
        run: curl ipinfo.io --socks5 localhost:9050

using with curl

# proxy usage (with dns leak)
curl --socks5 localhost:9050 ipinfo.io 
# onionsite usage
curl --socks5-hostname localhost:9050 facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion

using with python

import json, requests

def get_tor_session():
    session = requests.session()
    # we use socks5h to route dns through the socks proxy
    # this reduces the risk of dns leaks and allows hidden service resolutions
    session.proxies = {'http':  'socks5h://127.0.0.1:9050',
                       'https': 'socks5h://127.0.0.1:9050'}
    return session

# make a request through the established tor circuit
session = get_tor_session()
response = session.get("https://facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion")
print(json.dumps(dict(response.headers)))

About

a lightweight, containerised Tor SOCKS5 proxy 🐳

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages