Page cover

Ku-proxy wiki

Ku is fast, async, modern, little tcp man-in-the-middle proxy library, written in pure Python 3.

About

Ku is TCP main-in-the-middle proxy written in pure python3 on top of threading and select. Object orientated, functional, powerful.

Documentation

Quick intro

from ku import ku
from time import sleep

listen = (
    "localhost", 25565, # domain names are IPv4 only
    "127.0.0.1", 80, # IPv4
    "[::1]", 8000 # IPv6
)

upstream = ("localhost", 8080) # host where all connection goes
proxy = ku(listen, upstream)

# proxy = ku(listen, ("google.com", 443), upstream_6=True) upstream_6 if you wanna use ipv6 with domain name in upstream

while 7:
    try:
        sleep(0.07)
    except KeyboardInterrupt:
        proxy.shutdown() # proxy creates a thread to async poll for socket events
        break            # we need to call shutdown() to break the thread loop

Kun

proxy executable script / alpha test

Projects that use ku-proxy

Last updated

Was this helpful?