Commit Graph

68 Commits

Author SHA1 Message Date
pyup.io bot 6aed912554 Update pytest from 5.2.3 to 5.2.4 (#180) 2019-11-15 23:50:42 -08:00
Abhinav Singh 148c260472
Move dashboard backend within proxy module, now ships via same pip package (#177)
* Allow resources to load from http and ws when running w/o https

* Move dashboard backend (dashboard.py) within proxy module. Now shipped with pip install proxy.py

* Update ref to dashboard backend in github workflows

* Add git-pre-commit hook file.

Enable it by symlinking as .git/hooks/pre-commit

* Also enable static server for dashboard serving
2019-11-15 13:29:48 -08:00
Abhinav Singh 1ce16b95de
Update mypy==0.740 (#151) 2019-10-28 15:29:33 -07:00
Abhinav Singh e14548252c
Proxy.py Dashboard (#141)
* Remove redundant variables

* Initialize frontend dashboard app (written in typescript)

* Add a WebsocketFrame.text method to quickly build a text frame raw packet, also close connection for static file serving, atleast Google Chrome seems to hang up instead of closing the connection

* Add read_and_build_static_file_response method for reusability in plugins

* teardown websocket connection when opcode CONNECTION_CLOSE is received

* First draft of proxy.py dashboard

* Remove uglify, obfuscator is superb enough

* Correct generic V

* First draft of dashboard

* ProtocolConfig is now Flags

* First big refactor toward no-single-file-module

* Working tests

* Update dashboard for refactored imports

* Remove proxy.py as now we can just call python -m proxy -h

* Fix setup.py for refactored code

* Banner update

* Lint check

* Fix dashboard static serving and no UNDER_TEST constant necessary

* Add support for plugin imports when specified in path/to/module.MyPlugin

* Update README with instructions to run proxy.py after refactor

* Move dashboard under /dashboard path

* Rename to devtools.ts

* remove unused

* Update github workflow for new directory structure

* Update test command too

* Fix coverage generation

* *.py is an invalid syntax on windows

* No * on windows

* Enable execution via github zip downloads

* Github Zip downloads cannot be executed as Github puts project under a folder named after Github project, this breaks python interpreter expectation of finding a __main__.py in the root directory

* Forget zip runs for now

* Initialize ProxyDashboard on page load rather than within typescript i.e. on script load

* Enforce eslint with standard style

* Add .editorconfig to make editor compatible with various style requirements (Makefile, Typescript, Python)

* Remove extra empty line

* Add ability to pass headers with HttpRequestRejected exception, also remove proxy agent header for HttpRequestRejected

* Add ability to pass headers with HttpRequestRejected exception, also remove proxy agent header for HttpRequestRejected

* Fix tests

* Move common code under common sub-module

* Move flags under common module

* Move acceptor under core

* Move connection under core submodule

* Move chunk_parser under http

* Move http_parser as http/parser

* Move http_methods as http/methods

* Move http_proxy as http/proxy

* Move web_server as http/server

* Move status_codes as http/codes

* move websocket as http/websocket

* Move exception under http/exception, also move http/proxy exceptions under http/exceptions

* move protocol_handler as http/handler

* move devtools as http/devtools

* Move version under common/version

* Lifecycle if now core Event

* autopep8

* Add core event queue

* Register / unregister handler

* Enable inspection support for frontend dashboard

* Dont give an illusion of exception for HttpProtocolExceptions

* Update readme for refactored codebase

* DictQueueType everywhere

* Move all websocket API related code under WebsocketApi class

* Inspection enabled on tab switch.

1. Additionally now acceptors are assigned an int id.
2. Fix tests to match change in constructor.

* Corresponding ends of the work queues can be closed immediately.

Since work queues between AcceptorPool and Acceptor process is used only
once, close corresponding ends asap instead of at shutdown.

* No need of a manager for shared multiprocess Lock.

This unnecessarily creates additional manager process.

* Move threadless into its own module

* Merge acceptor and acceptor_pool tests

* Defer os.close

* Change content display with tab clicks.

Also ensure relay manager shutdown.

* Remove --cov flags

* Use right type for SyncManager

* Ensure coverage again

* Print help to discover flags, --cov certainly not available on Travis for some reason

* Add pytest-cov to requirements-testing

* Re-add windows on .travis also add changelog to readme

* Use 3.7 and no pip upgrade since it fails on travis windows

* Attempt to fix pip install on windows

* Disable windows on travis, it fails and uses 3.8.  Try reporting coverage from github actions

* Move away from coveralls, use codecov

* Codecov app installation either didnt work or token still needs to be passed

* Remove travis CI

* Use https://github.com/codecov/codecov-action for coverage uploads

* Remove run codecov

* Ha, codecov action only works on linux, what a mess

* Add cookie.js though unable to use it with es5/es6 modules yet

* Enable testing for python 3.8 also Build dashboard during testing

* No python 3.8 on github actions yet

* Autopep8

* Add separate workflows for library (python) and dashboard (node) app

* Type jobs not job

* Add checkout

* Fix parsing node version

* Fix dashboard build on windows

* Show codecov instead of coveralls
2019-10-28 14:57:33 -07:00
pyup.io bot 3b2b2e5dd5 Update py-spy from 0.2.2 to 0.3.0 (#144) 2019-10-28 14:43:46 -07:00
pyup.io bot e7e9e14e75 Update flake8 from 3.7.8 to 3.7.9 (#148) 2019-10-28 13:12:45 -07:00
pyup.io bot 57315289ae Update pytest from 5.2.1 to 5.2.2 (#142) 2019-10-26 20:38:22 -07:00
pyup.io bot c01f497ec9 Update py-spy from 0.1.11 to 0.2.2 (#117) 2019-10-09 22:41:15 -07:00
Abhinav Singh 908c0b5855
Chrome Devtool Integration first steps (#109)
* Initialize skeleton electron app

* Attempt to open devtools

* Electron free

* Initialize public/devtools

* Add basic support for static file serving and chrome devtools.

1. No cache header management for static file serving yet.
2. No chunked encoded responses for static files yet.
3. Chrome Devtool initialization.

* Fix static serving with query params

* profile using py-spy

* Complete websocket client loop

* lint check

* Add support for building websocket frames

* Remove redundant CDT params

* Lint check

* Refactor web server base plugin name

* Devtools integrated, need more polish

* Add START_TIME global var

* lint fix

* Remove outdated chrome rdp

* Add FAQs

* Add FAQs

* socket_connection decorator + context manager

* Defer SSL handshake and plugin initialize until protocol handler thread
has started.

This is a follow up to this PR
https://github.com/abhinavsingh/proxy.py/pull/111

* Add tests for new_socket_connection and its friend socket_connection

* Address an issue which came back after being fixed in https://github.com/abhinavsingh/proxy.py/pull/92

* Lint fixes

* uff ye str and bytes

* Remove explicit flushes outside of write ready descriptor handlers

* add links to import proxy

* Only try websocket upgrade if a route is registered

* Add plugin_examples.WebServerPlugin and use precision logging for levelname

* Remove redundant comments

* Add --devtools-ws-path flag

* Add on_websocket_open and on_websocket_close callbacks

* Add empty stubs for incomplete CDT responses

* Ensure client is ready before final flush

* Shutdown on write side of socket, may be client is still reading

* Since client.closed can be set, explicitly call client.connection.closed

* Add ModifyPostDataPlugin example.

Was first asked and referenced here
https://github.com/abhinavsingh/proxy.py/issues/115

* Start adding TestHttpProxyPlugin

* Fixes #116
2019-10-09 22:36:47 -07:00
pyup.io bot 75dd31b669 Update pytest from 5.2.0 to 5.2.1 (#113) 2019-10-07 03:56:53 -07:00
pyup.io bot 7e2dcdd443 Update pytest from 5.1.3 to 5.2.0 (#107) 2019-09-29 10:26:50 -07:00
pyup.io bot e38531b4c3 Update mypy from 0.720 to 0.730 (#99) 2019-09-26 11:23:42 -07:00
Abhinav Singh ccb1dbeb5f
Pluggable WebServer (#98)
* 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
2019-09-26 02:07:16 -07:00
pyup.io bot 8ecb76da2f Update twine from 1.15.0 to 2.0.0 (#88) 2019-09-24 09:13:11 -07:00
Abhinav Singh ae1f1d654c
mypy coverage (#78)
* mypy coverage

* First stab at mypy --strict complaince

* mypy --strict compliance.

* Run mypy during Quality Check phase
2019-09-22 21:11:55 -07:00
pyup.io bot 15796cf5de Initial Update (#74)
* 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
2019-09-21 14:51:51 -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 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