# ppy_proxy **Repository Path**: cw2016/ppy_proxy ## Basic Information - **Project Name**: ppy_proxy - **Description**: No description available - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-02 - **Last Updated**: 2021-03-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ppy_proxy #### 介绍 公司里只有http代理可以上网且http代理的connect协议能自动之识别只允许转发ssl/tls的数据。 那么可以通过此软件,在公司本地电脑部署客户端,在公网找一台服务器部署服务器端,就可以让公司内电脑内的软件通过socks5或tcp端口映射方式实现和外网通讯。 #### 软件架构 采用python3.7以上的asyncio库实现的tcp代理、socks5代理的ssl隧道程序。 #### 使用说明 1、制作私人证书和私钥cert.pem和key.pem openssl genrsa -out cert.pem 2048 openssl req -new -x509 -key key.pem -out cacert.pem -days 1095 2、采用python3的协程库编写的tcp代理转发Demo程序,学习用。 asyncio_tcp_proxy_demo.py 3、ppy_proxy.py的使用 #电脑1(公司内个人电脑) [connect ip4:port4]ssh_client + sockes5(127.0.0.1:7000): ppy_proxy.py client_main() json_cfg.local_ip = '0.0.0.0' json_cfg.local_port = 7000 json_cfg.remote_ip = ip2 json_cfg.remote_port = port2 json_cfg.target_ip = ip3 json_cfg.target_port = port3 json_cfg.listen_type = 'tcp' #tcp, socks5 json_cfg.next_type = 'http_connect' #tcp, http_connect json_cfg.listen_ssl = False json_cfg.next_ssl = True #电脑2(公司内http代理服务器) [listen ip2:port2]:http proxy(connect) server #电脑3(公司外公网服务器 [listen ip3:port3]ppy_proxy.py server_main() json_cfg.local_ip = '0.0.0.0' json_cfg.local_port = 7066 json_cfg.listen_type = 'tcp' #tcp, socks5 json_cfg.next_type = 'http_connect' #tcp, http_connect json_cfg.listen_ssl = False json_cfg.next_ssl = True #电脑4(公司外要访问的远程服务器) [listen ip4:port4]ssh_server