Skip to main content

Socks over Unix Domain Socket

Project description

Socks over Unix Domain Socket

opener = socks.build_opener(socks_path="/var/lib/tor-shared/public.socket")
with opener.open("https://www.google.com/") as fp:
    assert fp.code == 200
    assert fp.read(20) == b"<!doctype html><html"

Features

  • Allows applications to connect to internet with just unix domain socket
  • Works with containers and systemd private network
  • Supports both sync and async usage
  • urllib compatible build_opener
  • Optional httpcore transport for use with libraries like httpx

This is not a feature complete socks proxy. Only client mode is supported. It is designed for use with tor's unix socks socket

  • No support for socks bind
  • No support for udp
  • Only NoAuth and UserPass auth supported
  • Only supports socks5h protocol. Connects to the socks proxy as domain name. However ip string can be passed for domain name with tor

Usage

Please check socks_test.py and Makefile

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

socks_uds-1.3.tar.gz (11.4 kB view hashes)

Uploaded Source

Built Distribution

socks_uds-1.3-py3-none-any.whl (12.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page