Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.11 instead.

SocketSwap

SocketSwap is a tool that allows to proxy any third-party libraries traffic through a TCP SOCKS5 Proxy.

Some Python libaries support proxing out of the box like requests. For all other libaries especially ones not natively written in python, you can use SocketSwap to redirect traffic via a proxy.

Usage:

There are two ways to use SwapSock.

- Via a Context Manager that starts the proxy in a daemon process
- Directly as a blocking script

Context Manager

import socket
from SocketSwap import ProxySwapContext


def conn_factory():
    target_host = "localhost"
    target_port = 5432
    remote_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    remote_socket.connect((target_host, target_port))
    return remote_socket

def main():
    
    with ProxySwapContext(conn_factory, "127.0.0.1", 2222):
        # do something you want to proxy

The ProxySwapContext takes essentially 3 mandatory arguments.

Credits:

The TCP Proxy part is a slim modified version of https://github.com/ickerwx/tcpproxy.

Metadata

Release files for SocketSwap 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for SocketSwap 0.1.6
File Interpreter ABI Platform Actions
SocketSwap-0.1.6-py2.py3-none-any.whl Python 3, Python 2 none any Details for SocketSwap-0.1.6-py2.py3-none-any.whl

Release files / SocketSwap-0.1.6-py2.py3-none-any.whl

Download URL SocketSwap-0.1.6-py2.py3-none-any.whl
Size 7.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
52a6f9b73cb266cac6d93a347a96bee13ed103e49ab40d6611cc9d20ab703d7d
BLAKE2b-256 checksum
How to use checksums
0a0cf4b86c711fc6d981f012725124fbc4834180a9f614215a51f527dbca012a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Security for SocketSwap 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page