{ "info": { "author": "wetls", "author_email": "51704774+wetls@users.noreply.github.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Internet :: Proxy Servers" ], "description": "# WeTLSProxy\n\n![](https://img.shields.io/badge/language-Python3-blue.svg)\n![](https://img.shields.io/pypi/v/wetlsproxy.svg)\n\nWeTLSProxy is a secure proxy tool.\n\nThis tool can help you cross the firewall safely and quickly.\n\n\n# Environment requirements\n\nWindows or Linux\n\nPython 3.6 or higher\n\nRecommended to use the latest version of Python.\n\n# Install\n```bash\npip install wetlsproxy\n```\n\n# Instructions\n### Step 1 Generate a server certificate\nFirst you need to generate a TLS certificate. You can use the openssl command to generate a self-signed certificate.\n\nFor example\uff1a\n\nGenerate an RSA certificate\n\n```bash\nopenssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -keyout server.key -out server.crt\n```\n\nGenerate an ECC certificate\n\n```bash\nopenssl ecparam -out ecc.key -name secp384r1 -genkey\nopenssl req -new -newkey ec:ecc.key -days 3650 -nodes -x509 -keyout server.key -out server.crt\n```\n\n### Step 2 Create a configuration file\n\nCreate a default configuration file to use the command.\n\n```bash\n# The program will create config.json in the working directory\n# Tips\uff1aUUID will be randomly generated.\nwetls_proxy_config --create\n```\n\nYou can also choose to create a configuration file manually.\n\nSave the following as a file\n\n```bash\n{\n \"client_bind_address\": \"0.0.0.0\",\n \"client_bind_port\": 8140,\n \"remote_server_address\": \"127.0.0.1\",\n \"remote_server_port\": 8141,\n \"server_bind_address\": \"0.0.0.0\",\n \"server_bind_port\": 8141,\n \"server_cert_path\": \"{WORK_DIR}/server.crt\",\n \"server_key_path\": \"{WORK_DIR}/server.key\",\n \"min_padding_size\": 0,\n \"max_padding_size\": 255,\n \"user_uuid\": \"ee723deb-cfb6-4dac-bedf-0879fc79c6ec\"\n}\n```\nYou can modify it according to the path and support the use of environment variables.\n\nWarning\uff1aUUID please update yourself to ensure security.\n\n### Step 3 Run\n\nYou can start the program with the wetls_proxy_server and wetls_proxy_client commands.\n\nparameter:\n\n--config specifies the path to the configuration file.\n--debug is used to display debug output.\n\nExample:\n\nOn the server\n\n```bash\nwetls_proxy_server --config=/etc/wetls_proxy/config.json --debug\n```\n\nOn the client\n\n```bash\nwetls_proxy_client --config=/etc/wetls_proxy/config.json --debug\n```\n\n# Development\n## WeTLSProxy Protocol\n```python\n# request protocol\n'''\nrequest protocol start\n{\n \"uuid\": \"16 bytes\",\n \"timestamp\": \"8 bytes\",\n \"command\": \"1 bytes\",\n \"port number\": \"2 bytes\",\n \"address type\": \"1 bytes\",\n \"address len\": \"1 bytes\",\n \"address\": \"Variable\",\n \"random len\": \"1 bytes\",\n \"random data\": \"Variable\"\n}\n# command\n# only support TCP CONNECT\n# CONNECT 0x01\n\n# address type\n# domain name 0x01\n# IPV4 0x04\n# IPV6 0x06\n\nrequest protocol reply\n{\n \"status code\": \"1 bytes\",\n \"random len\": \"1 bytes\",\n \"random data\": \"Variable\"\n}\n# status code\n# 0x00 SUCCESS\n# 0x01 FAILED\n\nNOTE: \n All numbers are unsigned type.\n'''\n\n\n# data exchange protocol\n'''\n{\n \"command code\": \"1 bytes\",\n \"random len\": \"1 bytes\",\n \"random data\": \"Variable\"\n \"data len\": \"4 bytes\",\n \"data\": \"Variable\"\n}\n'''\n# command code\n# 0x00 exchange data\n# 0x01 keep connection\n# 0x02 disconnect\n```\n# License\n\nGPLv3 License\n\n# WeTLSProxy \u4f7f\u7528\u8bf4\u660e\uff08\u4e2d\u6587\u7248\u672c\uff09\n\n## WeTLSProxy \u8fd0\u884c\u73af\u5883\n\u652f\u6301\uff1aWindows\uff0cLinux\n\n\u9700\u8981Python 3.6 \u6216\u66f4\u9ad8\u7248\u672c\u3002\n\n## WeTLSProxy \u5de5\u4f5c\u65b9\u5f0f\n\u5de5\u4f5c\u6d41\u7a0b\uff1a\n\u6d41\u7a0b\u56fe\u5982\u65e0\u6cd5\u6b63\u5e38\u663e\u793a\u53ef\u4f7f\u7528 [stackedit.io](https://stackedit.io) \u8fdb\u884c\u6d4f\u89c8\u3002\n\n\u4e5f\u53ef\u76f4\u63a5\u67e5\u770bdoc\u6587\u4ef6\u5939\u4e0b\u7684 WeTLSProxy_work_process.svg\u3002\n\n\n```mermaid\nsequenceDiagram\nPC ->> WeTLSProxy_Client: Socks5 Request\nWeTLSProxy_Client ->> WeTLSProxy_Server: TLS connect\nWeTLSProxy_Client ->> WeTLSProxy_Server: WeTLSProxy Protocol Request\nWeTLSProxy_Server -->> Remote_Server: CONNECT\nWeTLSProxy_Server ->> WeTLSProxy_Client: WeTLSProxy Protocol Reply\nWeTLSProxy_Client ->> WeTLSProxy_Server: DATA\nWeTLSProxy_Server -->> Remote_Server: DATA\nRemote_Server -->> WeTLSProxy_Server: DATA\nWeTLSProxy_Server ->> WeTLSProxy_Client: DATA\nWeTLSProxy_Client ->> PC: DATA\n```\n\n\n## \u4f7f\u7528\u65b9\u6cd5\n### 1\u3001\u751f\u6210\u670d\u52a1\u5668\u8bc1\u4e66\n\u670d\u52a1\u5668\u9700\u8981\u8bc1\u4e66\u6765\u4fdd\u969c\u901a\u8baf\u5b89\u5168\uff0c\u53ef\u4ee5\u4f7f\u7528\u81ea\u7b7e\u8bc1\u4e66\u3002\n\n\u751f\u6210RSA\u8bc1\u4e66\n\n```bash\nopenssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 -keyout server.key -out server.crt\n```\n\n\u751f\u6210ECC\u8bc1\u4e66\n\n```bash\nopenssl ecparam -out ecc.key -name secp384r1 -genkey\nopenssl req -new -newkey ec:ecc.key -days 3650 -nodes -x509 -keyout server.key -out server.crt\n```\n### 2\u3001\u4fee\u6539\u521b\u5efa\u914d\u7f6e\u6587\u4ef6\n\n\u4f7f\u7528\u547d\u4ee4\u884c\u521b\u5efa\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u3002\n```bash\n# \u7a0b\u5e8f\u5c06\u4f1a\u5728\u5de5\u4f5c\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2aconfig.json\n# \u5176\u4e2dUUID\u4e3a\u968f\u673a\u751f\u6210\u7684\u3002\nwetls_proxy_config --create\n```\n\u4f60\u4e5f\u53ef\u4ee5\u9009\u62e9\u624b\u5de5\u521b\u5efa\u914d\u7f6e\u6587\u4ef6\u3002\n\u4fdd\u5b58\u5982\u4e0b\u5185\u5bb9\u5373\u53ef\u3002\n```bash\n{\n \"client_bind_address\": \"0.0.0.0\",\n \"client_bind_port\": 8140,\n \"remote_server_address\": \"127.0.0.1\",\n \"remote_server_port\": 8141,\n \"server_bind_address\": \"0.0.0.0\",\n \"server_bind_port\": 8141,\n \"server_cert_path\": \"{WORK_DIR}/server.crt\",\n \"server_key_path\": \"{WORK_DIR}/server.key\",\n \"min_padding_size\": 0,\n \"max_padding_size\": 255,\n \"user_uuid\": \"ee723deb-cfb6-4dac-bedf-0879fc79c6ec\"\n}\n```\n\u63d0\u793a\uff1a\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u8def\u5f84\u652f\u6301\u4f7f\u7528\u73af\u5883\u53d8\u91cf\u3002\n\u8b66\u544a\uff1a\u8bf7\u81ea\u884c\u4fee\u6539UUID\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u4ea7\u751f\u5b89\u5168\u95ee\u9898\u3002\n\nUUID\u53ef\u4ee5\u901a\u8fc7\u5728\u7ebf\u7f51\u7ad9\u751f\u6210\u3002\n\n\u7f51\u5740\uff1a[uuidgenerator](https://www.uuidgenerator.net/)\n\n\n### 4\u3001\u8fd0\u884c\u7a0b\u5e8f\n\n\u5982\u679c\u901a\u8fc7pip\u5b89\u88c5\u53ef\u901a\u8fc7wetls_proxy_server\u548cwetls_proxy_client\u547d\u4ee4\u76f4\u63a5\u542f\u52a8\u3002\n\n\u53c2\u6570\uff1a\n--config \u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u7684\u8def\u5f84\u3002\n--debug \u53c2\u6570\u7528\u4e8e\u663e\u793adebug\u8f93\u51fa\u3002\n\n\u4e3e\u4f8b\uff1a\n\u670d\u52a1\u7aef\n```bash\nwetls_proxy_server --config=/etc/wetls_proxy/config.json --debug\n```\n\n\u5ba2\u6237\u7aef\n```bash\nwetls_proxy_client --config=/etc/wetls_proxy/config.json --debug\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wetls/WeTLSProxy", "keywords": "", "license": "https://www.gnu.org/licenses/gpl-3.0.en.html", "maintainer": "", "maintainer_email": "", "name": "wetlsproxy", "package_url": "https://pypi.org/project/wetlsproxy/", "platform": "", "project_url": "https://pypi.org/project/wetlsproxy/", "project_urls": { "Homepage": "https://github.com/wetls/WeTLSProxy" }, "release_url": "https://pypi.org/project/wetlsproxy/0.0.7/", "requires_dist": null, "requires_python": "", "summary": "WeTLSProxy is a secure proxy tool.", "version": "0.0.7" }, "last_serial": 5687709, "releases": { "0.0.5": [ { "comment_text": "", "digests": { "md5": "e24c6f320bd98eaf182fb3f4c9ed48db", "sha256": "5c88147e1a1bc8b192f28b987c45ae09f20b3d12450a5456cfb98788ad828035" }, "downloads": -1, "filename": "wetlsproxy-0.0.5.tar.gz", "has_sig": false, "md5_digest": "e24c6f320bd98eaf182fb3f4c9ed48db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10494, "upload_time": "2019-07-09T09:28:41", "url": "https://files.pythonhosted.org/packages/70/b3/930c96dbb2866075dc4d21d203b5482aa5c6f0904ccdce7a0168b00978a7/wetlsproxy-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "c71cf8377d64a12df8372de06a8bb415", "sha256": "992a3b2261b180501527aeaf68979b3e3d6355a666e11453461a2e48e7e1b258" }, "downloads": -1, "filename": "wetlsproxy-0.0.6.tar.gz", "has_sig": false, "md5_digest": "c71cf8377d64a12df8372de06a8bb415", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10834, "upload_time": "2019-07-13T07:52:16", "url": "https://files.pythonhosted.org/packages/7a/da/41836ea85f6abac5ea6860eb5caca03c2fae34e9c8dd880ceeb2afda9876/wetlsproxy-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "9e83017c38a7e902d0870068778f3f2e", "sha256": "1dd707db3d989293479b89f6546e115eac8d5eb18ac0f70838ae7c9b2dc26fbe" }, "downloads": -1, "filename": "wetlsproxy-0.0.7.tar.gz", "has_sig": false, "md5_digest": "9e83017c38a7e902d0870068778f3f2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14786, "upload_time": "2019-08-16T13:37:04", "url": "https://files.pythonhosted.org/packages/25/7c/8a46bc32fa37c6dec0426bcbb11876316566c83f4b2af48e3e508cf31e35/wetlsproxy-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9e83017c38a7e902d0870068778f3f2e", "sha256": "1dd707db3d989293479b89f6546e115eac8d5eb18ac0f70838ae7c9b2dc26fbe" }, "downloads": -1, "filename": "wetlsproxy-0.0.7.tar.gz", "has_sig": false, "md5_digest": "9e83017c38a7e902d0870068778f3f2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14786, "upload_time": "2019-08-16T13:37:04", "url": "https://files.pythonhosted.org/packages/25/7c/8a46bc32fa37c6dec0426bcbb11876316566c83f4b2af48e3e508cf31e35/wetlsproxy-0.0.7.tar.gz" } ] }