Code Monkey home page Code Monkey logo

pyproxy's Introduction

PyProxy

A simple http/https proxy that helps you bypass firewalls

Dependency

  • socket
  • threading

How to use it?

For Server:

def main():
	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	sock.bind(('0.0.0.0', 5200))
	sock.listen(4096)

You can modify the server listen port, the maximum number of TCP keep-alive connections here.

And then, run python server.py to start the proxy server.

For Client:

def main():
	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	sock.bind(('127.0.0.1', 1080))
	sock.listen(256)

You can modify the client listen port, the maximum number of TCP keep-alive connections here.

def clientIn(client, address):
	sockr = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	try:
		sockr.connect(('127.0.0.1', 5200))

You should put your server ip and port here.

And then, run python client.py to start the proxy client.

Demo Server

Server Address: pp.pakho.xyz

Server Port: 5200

Finally

Configure http/https(not socks4/socks5) proxy with your client ip and port in any software supported it.

Have fun!

License

PyProxy is published under MIT License. See the LICENSE file for more.


PyProxy

一个简单的http/https代理,可以帮助你穿越防火墙

依赖

  • socket
  • threading

怎样使用?

服务端:

def main():
	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	sock.bind(('0.0.0.0', 5200))
	sock.listen(4096)

你可以在这里设置服务器IP和监听端口,还可以修改最大TCP连接数。

然后,运行 python server.py 启动服务端。

客户端:

def main():
	sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	sock.bind(('127.0.0.1', 1080))
	sock.listen(256)

你可以在这里设置本地客户端的监听端口,还可以修改最大TCP连接数。

def clientIn(client, address):
	sockr = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	try:
		sockr.connect(('127.0.0.1', 5200))

你应该把服务器IP和端口填在这里。

然后,运行 python client.py 启动客户端。

测试服务器

服务器地址: pp.pakho.xyz

服务器端口: 5200

最后

在你的软件中,使用客户端IP和端口来配置http/https代理,不是socks4/socks5代理。

祝你愉快!

许可协议

PyProxy采用MIT许可协议。查看LICENSE文件了解更多。

pyproxy's People

Contributors

impakho avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.