Skip to content

n0n3m4/pyproxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyProxy - Very Simple TCP/UDP Proxy

About

PyProxy is a very simple TCP/UDP pure Python proxy. It can be easily extended for custom data handling logic.

Usage

>pyproxy.py -h
usage: pyproxy.py [-h] (--tcp | --udp) -s SRC -d DST [-q | -v]

TCP/UPD proxy.

optional arguments:
  -h, --help         show this help message and exit
  --tcp              TCP proxy
  --udp              UDP proxy
  -s SRC, --src SRC  Source IP and port, i.e.: 127.0.0.1:8000
  -d DST, --dst DST  Destination IP and port, i.e.: 127.0.0.1:8888
  -q, --quiet        Be quiet
  -v, --verbose      Be loud

Custom data handlers

Proxy uses two data handlers for incoming and outgoing data. By default both are set to identity function.

LOCAL_DATA_HANDLER = lambda x:x
REMOTE_DATA_HANDLER = lambda x:x

One can easily implement own rules. It might be very useful while testing network applications.

def custom_data_handler(data):
    # code goes here
    pass
    
LOCAL_DATA_HANDLER = custom_data_handler
REMOTE_DATA_HANDLER = lambda x:'constant_value'

License

Code is released under MIT license © Radoslaw '[rsc]' Matusiak.

About

Very Simple TCP/UDP Proxy.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%