File: socks4server.py

package info (click to toggle)
python-socksipy 1.6.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 164 kB
  • ctags: 115
  • sloc: python: 779; sh: 19; makefile: 3
file content (14 lines) | stat: -rwxr-xr-x 391 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python
from twisted.internet import reactor
from twisted.protocols.socks import SOCKSv4Factory

def run_proxy():
    reactor.listenTCP(1080, SOCKSv4Factory("/dev/null"), interface="127.0.0.1")
    try:
        reactor.run()
    except (KeyboardInterrupt, SystemExit):
        reactor.stop()

if __name__ == "__main__":
    print("Running SOCKS4 proxy server")
    run_proxy()