--- id: socketswap version: "0.1.11" license: MIT license_treatment: permissive maintenance: dormant --- # SocketSwap — SocketSwap is a python package that allows to proxy any third-party libraries traffic through a local TCP Proxy License: permissive · Maintenance: dormant · Downloads: 468.8K/mo ## What it is and what it does SocketSwap is a Python proxy wrapper that intercepts socket connections from third-party libraries and routes them through a local TCP SOCKS5 proxy. It solves the problem of adding proxy support to libraries that don't natively provide it—useful when you need to tunnel traffic through a corporate proxy, VPN, or other intermediary without modifying the library code itself. The package offers two usage modes: a context manager that runs the proxy in a daemon process, or a direct blocking script. It has no runtime dependencies and installs cleanly. However, it is dormant—the last release was 2023-09-29 and the last commit 2024-01-15—so it receives no active maintenance, and the repository has minimal adoption (2 stars). Use it for: - Proxy database client connections (e.g., psycopg2, pymongo) through a corporate firewall or VPN. - Route third-party library HTTP/HTTPS traffic through a SOCKS5 proxy without modifying library code. - Test applications behind a proxy by intercepting and redirecting socket connections in a test harness. - Tunnel non-Python native libraries' network traffic through a proxy in mixed-language environments. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. SocketSwap intercepts and redirects network traffic from third-party Python libraries through a local TCP SOCKS5 proxy, enabling proxy support for libraries that don't natively provide it. Yes, if you have a specific need to proxy a library that lacks native proxy support and you accept the maintenance risk. The package is simple, has no dependencies, and carries a permissive license. However, dormancy (last update 2024-01-15, only 2 stars) means you should verify it works with your target library and Python version before relying on it in production, and be prepared to fork or patch it if issues arise. ## Install pip install socketswap uv add socketswap poetry add socketswap ## Installing SocketSwap Before you install: Installation is straightforward with no runtime dependencies. The package is dormant—last updated 2024-01-15 with only 2 repository stars—so expect no active maintenance or bug fixes. License in practice: MIT license is permissive; you can use, modify, and distribute SocketSwap freely in commercial or private projects with minimal restrictions. Quickstart: from SocketSwap import ProxySwapContext import socket def socket_factory(): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("localhost", 5432)) return s with ProxySwapContext(socket_factory, "127.0.0.1", 2222): # traffic now proxied through 127.0.0.1:2222 pass Requires a working SOCKS5 proxy server already running and accessible at the address you specify. Verify before relying: - Whether the package works reliably with modern Python versions beyond 3.5, given classifiers list only 3.4 and 3.5. - Whether the package handles concurrent connections or is limited to single-threaded use. - Real-world stability and edge-case handling given the minimal repository activity and low star count. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 468.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python socks5 proxy wrapper, redirect library traffic through proxy, tcp proxy for python libraries, network traffic interception, socks5 proxy context manager, library traffic redirection, proxy socket wrapper, proxy-wrapper, socks5, socket-interception [View on SkillFed](https://skillfed.io/packages/socketswap) · [View on PyPI](https://pypi.org/project/socketswap/)