Commit Graph

16 Commits

Author SHA1 Message Date
Abhinav Singh 9e950436a7
Lint & Doc (#91)
* Remove redundant __init__ from plugins

* autopep8

* Add plugin developer and contributor guide

* Wordings
2019-09-24 22:43:29 -07:00
Abhinav Singh 92142a70d9
Add support for TLS/SSL interception and HTTPS server (#86)
* Handle OSError thrown when curl --proxy-cacert flag is invalid

* Add server-cert

* Dockerfile dont need --ipv4 since now its auto-detected and deprecated

* Add make server-cert info

* Add support for HTTPS interception.

1) Start as

    proxy.py --ca-key-file ca-key.pem --ca-cert-file ca-cert.pem --ca-signing-key-file ca-signing-key.pem

2) Test using curl

    curl -v -L -x proxy.py:8899 --cacert ca-cert.pem https://google.com

Now proxy.py is able to decrypt HTTPS traffic between curl and
google.com.  Generated certificates are stored under ~/.proxy.py
directory.

* Add comments for why interception do not work if client is communicating with proxy.py over https

* Fix tests

* Exit with message when trying to https intercept and also serve over https

* lint

* Disable OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_TLSv1, OP_NO_TLSv1_1 when wrapping upstream server socket

* Ensure client.conn.shutdown is called if necessary.

* Add mypy check for plugin_examples.py

* Exception handling when client sends invalid requests

* Verify plugin_examples

* mypy compat

* HttpRequestRejected
2019-09-24 19:02:57 -07:00
Abhinav Singh 5bdfd20ce8
Use ipaddress type and avoid explicit Connection: close header to upstream (#76)
* Fixes #71 and address some of #75

* Fix tests as IPV6 is default now

* Add comments and raise from e
2019-09-21 19:20:27 -07:00
Abhinav Singh 5eb4d8a97c
Use Pipe instead of Queue when passing sockets (#69)
* Use pipes instead of queues.

Possible solution for #68

* Handle ConnectionRefusedError

* Close corresponding pipes on shutdown

* Abstract classes for plugins.

* Add github workflows

* Use pytest for github workflow

* Add Windows/Mac workflows

* Use os.matrix

* 3.8 and 3.9 probably dont exists yet

* Do not fail-fast, also python 3.5 seems to be throwing syntax error for typing

* autopep8

* Disable windows-latest workflow which seems to hang
2019-09-16 20:18:14 -07:00
Abhinav Singh 8489e8bc2f Fix default listen on IPV6 for linux systems.
Closes #59
2019-09-02 11:20:26 -07:00
Abhinav Singh fcfbec4760 Add coveralls integration
No use mirrors

Enforce coverage3

Add coverage badge and use python -m to invoke coverage

Enforce pip3, remove SyntaxError reported line

Use develop branch for coverage status
2019-08-26 10:54:17 -07:00
Abhinav Singh eeb983f988 Add tests for HttpRequestRejected responses and open file limit setter. 2019-08-24 11:31:55 -07:00
Abhinav Singh 8ba63b1821 Add --version flag also used by Makefile for releases. 2019-08-24 10:23:30 -07:00
Abhinav Singh 653163532c Remove -v flag 2019-08-11 21:43:26 -07:00
Abhinav Singh 085bc2f927 Release docker container and prep for v0.4 2019-02-08 21:13:34 -08:00
Abhinav Singh 6b64c23c47 Prepare for v0.3 release 2019-02-08 18:57:44 -08:00
Abhinav Singh fcdae0e9c4 Fixes #20 HttpParser bug content-length is missing 2018-12-22 12:43:17 -08:00
Abhinav Singh 15b6fde86e Add Dockerfile and build rule 2018-12-22 07:08:04 -08:00
Abhinav Singh 917564b1d2 Fix Python3 warnings thrown while running tests
1. can't concat str to bytes
2. ResourceWarning: unclosed
2018-12-10 14:43:44 +05:30
Abhinav Singh ae0551e3fa refactor + add tests 2014-02-21 03:26:27 +05:30
Abhinav Singh 755f0e07a1 variablize reply pkt, ignore, Makefile 2013-12-24 03:21:45 +05:30