-
-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v1.0.0 Release #64
Merged
Merged
v1.0.0 Release #64
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Travis CI Support
Add header "Proxy-Authenticate" into 407 response.
Added --pac-file option to serve a Proxy Autoconfig file
Log Level CLI arguments
Use `--ipv4 1` to only listen on IPv4. Fixes #48
Default listen on IPv6 now.
Pre-spawn worker processes to utilize all cores.
This can be an issue with pipelining, but ideally should also be assisted by time-to-live logic. Currently, we drop connection if it is idle for more than max allowed idle time.
Some users are already being effected by this, however master branch is still stable. Python 2.7 users can continue using the master branch or simply install via pip. This change also targets issue#58
Unfortunately collections.namedtuple isn't supported by mypy and most likely never will be. Idea will be to use Typing.NamedTuple but this require some code refactoring.
* 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
* Fix HttpParser to correctly reach COMPLETE state. Fixes #70, see test case test_pip_connect * Remove redundant logic. * Lint fixes
* Update coverage from 4.5.2 to 4.5.4 * Update twine from 1.12.1 to 1.15.0 * Update pytest from 5.1.2 to 5.1.3
* Resolve issues reported by Bandit * Fix tests
* mypy coverage * First stab at mypy --strict complaince * mypy --strict compliance. * Run mypy during Quality Check phase
* Make docker v1.0.0 release * 👍 * 👍 📱 💻 💡 * 👍 📱 💻 💡
* Can serve proxy traffic over HTTPS. Pass --certfile and --keyfile arguments to enable SSL/TLS layer. Example: 1) Start proxy.py as ./proxy.py --certfile cert.pem --keyfile key.pem 2) Then verify via curl curl -v -x https://localhost:8899 --proxy-cacert cert.pem http://httpbin.org/get * Add --ignore-missing-imports for missing multiprocessing.reduction module * mock socket.fromfd to avoid sys calls * Add HTTPS info * Add TLS encryption * Add TLS encryption
* 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
* Add documentation * Add TOC * Add links to encryption and tls * fix cert-file and key-file * Add example for verification of https and tls interception * Bigger fonts * Redact
* Remove redundant __init__ from plugins * autopep8 * Add plugin developer and contributor guide * Wordings
* Add tests and mypy compliance for tests * Add pragma: no cover for abstract class methods * mypy --strict compliance for tests.py * Refactor and test coverage * lint fixes
* Enable windows and pre/dev python releases * Move twine to requirements-release.txt * 3.5 do not support type annotations * Use inbuild build_request, build_response methods now. * First cut of web server route plugin architecture * Add route decorator * mypy * disable TestMultiCoreRequestDispatcherIntegration for github * Anyways it doesnt format as advertised
* Always deduce address family as we have a structure * Convert TcpConnection into an ABC. * Fix tests * Rename MultiCoreRequestDispatcher to WorkerPool * Consistent naming refactor * Make WorkerPool independent of protocol config object * Fix tests * Proper fix for test_on_client_connection_called_on_teardown * TLS interception * better logging
* Add ProposedRestApiPlugin example. This plugin is an example to demonstrate how `proxy.py` can help you test and debug client applications without actually having a need of backend server. Simply modify ProposedRestApiPlugin as per need to return json responses for your API specs. * Add README instructions * Correct username
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See https://github.com/abhinavsingh/proxy.py/blob/032a6f26c94eb136c6449a438ae17d493257141e/README.md for full list of changes.
Since core APIs have changed vastly, we'll skip
v0.4and jump tov1.0
. Withproxy.py v1.0
is now more scalable and performant (utilizes multi-core) as well as now supports customizations via plugins.Python2.7support.macOS
,Linux
,Windows
HttpProtocolHandler
now implements base Http RFC. It supports core plugins for custom handling of incoming Http Client requests.HttpProtocolBasePlugin
to add your own custom request handling, however in most case you probably simply want to implementHttpProxyBasePlugin
(see below)HttpProxyPlugin
andHttpWebServerPlugin
internal plugins now provide core logic on top of core APIs. They themselves support their own plugin system :). Yes its a pluggable framework.TcpServer
now pre-spawns N worker processes to handle incoming client requests. This ensures utilization across CPU cores.N == Number of CPU cores
HttpProxyPlugin
itself supports plugin. ImplementHttpProxyBasePlugin
to customize proxy request behavior. See plugins_examples.py for a few implementations.HttpWebServerPlugin
too supports plugin. Patch your method withHttpWebServerBasePlugin.route
or implementHttpWebServerBasePlugin
to customize http web server behavior.v1.0
:--disable-headers
: List of comma separated headers which should be dropped before dispatching client request to upstream server.--pac-file PAC_FILE
: A file (Proxy Auto Configuration) or string to serve when the server receives a direct file request. See proxy.pac for a sample PAC configuration.--pac-file-url-path PAC_FILE_URL_PATH
: Web server path to serve the PAC file.--pid-file PID_FILE
: Default: None. Save parent process ID to a file.--plugins PLUGINS
: Comma separated plugins. Example--plugins plugin_examples. SaveHttpResponses
--enable-http-proxy
: Default: True. Whether to enable proxy.HttpProxyPlugin.--enable-web-server
: Default: False. Whether to enable proxy.HttpWebServerPlugin.--log-level LOG_LEVEL
:Valid options: DEBUG, INFO (default), WARNING, ERROR,
CRITICAL. Both upper and lowercase values are
allowed.You may also simply use the leading character
e.g. --log-level d
--log-file LOG_FILE
: Default: sys.stdout. Log file destination.--log-format LOG_FORMAT
: Log format for Python logger.--version
: Prints proxy.py version.