diff options
author | Aldo Cortesi <aldo@corte.si> | 2016-02-17 10:35:41 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2016-02-17 10:35:41 +1300 |
commit | 887ecf88967fe6caf8f8d5443e49b6bfcfbfcd0d (patch) | |
tree | 4c3b4f9cc555a945ddbeeb1b179070ef98b2eeff | |
parent | ef8e95956d938fd4891d79fdbfa83f8a77a482cb (diff) | |
parent | b87797ea255a0e2058e0574a5a00150f7f2df5db (diff) | |
download | mitmproxy-887ecf88967fe6caf8f8d5443e49b6bfcfbfcd0d.tar.gz mitmproxy-887ecf88967fe6caf8f8d5443e49b6bfcfbfcd0d.tar.bz2 mitmproxy-887ecf88967fe6caf8f8d5443e49b6bfcfbfcd0d.zip |
Merge pull request #950 from Kriechi/rename
Rename lib folders
-rw-r--r-- | .appveyor.yml | 2 | ||||
-rw-r--r-- | .coveragerc | 2 | ||||
-rw-r--r-- | .gitattributes | 4 | ||||
-rw-r--r-- | .landscape.yml | 2 | ||||
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | README.rst | 4 | ||||
-rw-r--r-- | mitmproxy/MANIFEST.in | 2 | ||||
-rw-r--r-- | mitmproxy/bin/mitmdump | 3 | ||||
-rwxr-xr-x | mitmproxy/bin/mitmproxy | 3 | ||||
-rwxr-xr-x | mitmproxy/bin/mitmweb | 4 | ||||
-rw-r--r-- | mitmproxy/docs/Makefile | 2 | ||||
-rw-r--r-- | mitmproxy/docs/conf.py | 8 | ||||
-rw-r--r-- | mitmproxy/docs/dev/exceptions.rst | 2 | ||||
-rw-r--r-- | mitmproxy/docs/dev/models.rst | 2 | ||||
-rw-r--r-- | mitmproxy/docs/dev/protocols.rst | 2 | ||||
-rw-r--r-- | mitmproxy/docs/dev/proxy.rst | 2 | ||||
-rw-r--r-- | mitmproxy/docs/dev/testing.rst | 26 | ||||
-rw-r--r-- | mitmproxy/docs/features/filters.rst | 2 | ||||
-rw-r--r-- | mitmproxy/docs/howmitmproxy.rst | 2 | ||||
-rw-r--r-- | mitmproxy/docs/index.rst | 2 | ||||
-rw-r--r-- | mitmproxy/docs/introduction.rst | 2 | ||||
-rw-r--r-- | mitmproxy/docs/scripting/inlinescripts.rst | 34 | ||||
-rw-r--r-- | mitmproxy/docs/scripting/mitmproxy.rst (renamed from mitmproxy/docs/scripting/libmproxy.rst) | 8 | ||||
-rw-r--r-- | mitmproxy/examples/README | 4 | ||||
-rw-r--r-- | mitmproxy/examples/custom_contentviews.py | 2 | ||||
-rw-r--r-- | mitmproxy/examples/filt.py | 2 | ||||
-rw-r--r-- | mitmproxy/examples/flowbasic | 4 | ||||
-rw-r--r-- | mitmproxy/examples/flowwriter.py | 2 | ||||
-rw-r--r-- | mitmproxy/examples/iframe_injector.py | 2 | ||||
-rw-r--r-- | mitmproxy/examples/modify_response_body.py | 2 | ||||
-rw-r--r-- | mitmproxy/examples/nonblocking.py | 2 | ||||
-rw-r--r-- | mitmproxy/examples/read_dumpfile | 2 | ||||
-rw-r--r-- | mitmproxy/examples/redirect_requests.py | 2 | ||||
-rw-r--r-- | mitmproxy/examples/stickycookies | 4 | ||||
-rw-r--r-- | mitmproxy/examples/tls_passthrough.py | 4 | ||||
-rw-r--r-- | mitmproxy/examples/upsidedownternet.py | 2 | ||||
-rw-r--r-- | mitmproxy/mitmdump | 3 | ||||
-rwxr-xr-x | mitmproxy/mitmproxy | 3 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/__init__.py (renamed from mitmproxy/libmproxy/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/cmdline.py (renamed from mitmproxy/libmproxy/cmdline.py) | 4 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/__init__.py (renamed from mitmproxy/libmproxy/console/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/common.py (renamed from mitmproxy/libmproxy/console/common.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/flowdetailview.py (renamed from mitmproxy/libmproxy/console/flowdetailview.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/flowlist.py (renamed from mitmproxy/libmproxy/console/flowlist.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/flowview.py (renamed from mitmproxy/libmproxy/console/flowview.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/grideditor.py (renamed from mitmproxy/libmproxy/console/grideditor.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/help.py (renamed from mitmproxy/libmproxy/console/help.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/options.py (renamed from mitmproxy/libmproxy/console/options.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/palettepicker.py (renamed from mitmproxy/libmproxy/console/palettepicker.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/palettes.py (renamed from mitmproxy/libmproxy/console/palettes.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/pathedit.py (renamed from mitmproxy/libmproxy/console/pathedit.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/searchable.py (renamed from mitmproxy/libmproxy/console/searchable.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/select.py (renamed from mitmproxy/libmproxy/console/select.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/signals.py (renamed from mitmproxy/libmproxy/console/signals.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/statusbar.py (renamed from mitmproxy/libmproxy/console/statusbar.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/tabs.py (renamed from mitmproxy/libmproxy/console/tabs.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/console/window.py (renamed from mitmproxy/libmproxy/console/window.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contentviews.py (renamed from mitmproxy/libmproxy/contentviews.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/README (renamed from mitmproxy/libmproxy/contrib/README) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/__init__.py (renamed from mitmproxy/libmproxy/contrib/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/jsbeautifier/__init__.py (renamed from mitmproxy/libmproxy/contrib/jsbeautifier/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd (renamed from mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/__init__.py (renamed from mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/evalbased.py (renamed from mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/evalbased.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/javascriptobfuscator.py (renamed from mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/javascriptobfuscator.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/myobfuscate.py (renamed from mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/myobfuscate.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/packer.py (renamed from mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/packer.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/urlencode.py (renamed from mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/urlencode.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/tls/__init__.py (renamed from mitmproxy/libmproxy/contrib/tls/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/tls/_constructs.py (renamed from mitmproxy/libmproxy/contrib/tls/_constructs.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/tls/utils.py (renamed from mitmproxy/libmproxy/contrib/tls/utils.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/wbxml/ASCommandResponse.py (renamed from mitmproxy/libmproxy/contrib/wbxml/ASCommandResponse.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/wbxml/ASWBXML.py (renamed from mitmproxy/libmproxy/contrib/wbxml/ASWBXML.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/wbxml/ASWBXMLByteQueue.py (renamed from mitmproxy/libmproxy/contrib/wbxml/ASWBXMLByteQueue.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/wbxml/ASWBXMLCodePage.py (renamed from mitmproxy/libmproxy/contrib/wbxml/ASWBXMLCodePage.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/wbxml/GlobalTokens.py (renamed from mitmproxy/libmproxy/contrib/wbxml/GlobalTokens.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/wbxml/InvalidDataException.py (renamed from mitmproxy/libmproxy/contrib/wbxml/InvalidDataException.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/contrib/wbxml/__init__.py (renamed from mitmproxy/libmproxy/contrib/wbxml/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/controller.py (renamed from mitmproxy/libmproxy/controller.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/dump.py (renamed from mitmproxy/libmproxy/dump.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/exceptions.py (renamed from mitmproxy/libmproxy/exceptions.py) | 2 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/filt.py (renamed from mitmproxy/libmproxy/filt.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/flow.py (renamed from mitmproxy/libmproxy/flow.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/flow_export.py (renamed from mitmproxy/libmproxy/flow_export.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/flow_format_compat.py (renamed from mitmproxy/libmproxy/flow_format_compat.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/main.py (renamed from mitmproxy/libmproxy/main.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/models/__init__.py (renamed from mitmproxy/libmproxy/models/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/models/connections.py (renamed from mitmproxy/libmproxy/models/connections.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/models/flow.py (renamed from mitmproxy/libmproxy/models/flow.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/models/http.py (renamed from mitmproxy/libmproxy/models/http.py) | 2 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/__init__.py (renamed from mitmproxy/libmproxy/onboarding/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/app.py (renamed from mitmproxy/libmproxy/onboarding/app.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/static/bootstrap.min.css (renamed from mitmproxy/libmproxy/onboarding/static/bootstrap.min.css) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/static/fontawesome/css/font-awesome.css (renamed from mitmproxy/libmproxy/onboarding/static/fontawesome/css/font-awesome.css) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/static/fontawesome/css/font-awesome.min.css (renamed from mitmproxy/libmproxy/onboarding/static/fontawesome/css/font-awesome.min.css) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/FontAwesome.otf (renamed from mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/FontAwesome.otf) | bin | 62856 -> 62856 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.eot (renamed from mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.eot) | bin | 38205 -> 38205 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.svg (renamed from mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.svg) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.ttf (renamed from mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.ttf) | bin | 80652 -> 80652 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.woff (renamed from mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.woff) | bin | 44432 -> 44432 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/static/mitmproxy.css (renamed from mitmproxy/libmproxy/onboarding/static/mitmproxy.css) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/templates/frame.html (renamed from mitmproxy/libmproxy/onboarding/templates/frame.html) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/templates/index.html (renamed from mitmproxy/libmproxy/onboarding/templates/index.html) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/onboarding/templates/layout.html (renamed from mitmproxy/libmproxy/onboarding/templates/layout.html) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/platform/__init__.py (renamed from mitmproxy/libmproxy/platform/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/platform/linux.py (renamed from mitmproxy/libmproxy/platform/linux.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/platform/osx.py (renamed from mitmproxy/libmproxy/platform/osx.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/platform/pf.py (renamed from mitmproxy/libmproxy/platform/pf.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/platform/windows.py (renamed from mitmproxy/libmproxy/platform/windows.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/protocol/__init__.py (renamed from mitmproxy/libmproxy/protocol/__init__.py) | 2 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/protocol/base.py (renamed from mitmproxy/libmproxy/protocol/base.py) | 22 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/protocol/http.py (renamed from mitmproxy/libmproxy/protocol/http.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/protocol/http1.py (renamed from mitmproxy/libmproxy/protocol/http1.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/protocol/http2.py (renamed from mitmproxy/libmproxy/protocol/http2.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/protocol/http_replay.py (renamed from mitmproxy/libmproxy/protocol/http_replay.py) | 4 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/protocol/rawtcp.py (renamed from mitmproxy/libmproxy/protocol/rawtcp.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/protocol/tls.py (renamed from mitmproxy/libmproxy/protocol/tls.py) | 6 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/proxy/__init__.py (renamed from mitmproxy/libmproxy/proxy/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/proxy/config.py (renamed from mitmproxy/libmproxy/proxy/config.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/proxy/modes/__init__.py (renamed from mitmproxy/libmproxy/proxy/modes/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/proxy/modes/http_proxy.py (renamed from mitmproxy/libmproxy/proxy/modes/http_proxy.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/proxy/modes/reverse_proxy.py (renamed from mitmproxy/libmproxy/proxy/modes/reverse_proxy.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/proxy/modes/socks_proxy.py (renamed from mitmproxy/libmproxy/proxy/modes/socks_proxy.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/proxy/modes/transparent_proxy.py (renamed from mitmproxy/libmproxy/proxy/modes/transparent_proxy.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/proxy/root_context.py (renamed from mitmproxy/libmproxy/proxy/root_context.py) | 12 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/proxy/server.py (renamed from mitmproxy/libmproxy/proxy/server.py) | 6 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/script/__init__.py (renamed from mitmproxy/libmproxy/script/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/script/concurrent.py (renamed from mitmproxy/libmproxy/script/concurrent.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/script/reloader.py (renamed from mitmproxy/libmproxy/script/reloader.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/script/script.py (renamed from mitmproxy/libmproxy/script/script.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/script/script_context.py (renamed from mitmproxy/libmproxy/script/script_context.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/stateobject.py (renamed from mitmproxy/libmproxy/stateobject.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/tnetstring.py (renamed from mitmproxy/libmproxy/tnetstring.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/utils.py (renamed from mitmproxy/libmproxy/utils.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/version.py (renamed from mitmproxy/libmproxy/version.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/web/__init__.py (renamed from mitmproxy/libmproxy/web/__init__.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/web/app.py (renamed from mitmproxy/libmproxy/web/app.py) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/app.css (renamed from mitmproxy/libmproxy/web/static/app.css) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/app.js (renamed from mitmproxy/libmproxy/web/static/app.js) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.eot (renamed from mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.eot) | bin | 56006 -> 56006 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.svg (renamed from mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.svg) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.ttf (renamed from mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.ttf) | bin | 112160 -> 112160 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.woff (renamed from mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.woff) | bin | 65452 -> 65452 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/chrome-devtools/LICENSE (renamed from mitmproxy/libmproxy/web/static/images/chrome-devtools/LICENSE) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourceCSSIcon.png (renamed from mitmproxy/libmproxy/web/static/images/chrome-devtools/resourceCSSIcon.png) | bin | 1005 -> 1005 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourceDocumentIcon.png (renamed from mitmproxy/libmproxy/web/static/images/chrome-devtools/resourceDocumentIcon.png) | bin | 951 -> 951 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourceJSIcon.png (renamed from mitmproxy/libmproxy/web/static/images/chrome-devtools/resourceJSIcon.png) | bin | 787 -> 787 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourcePlainIcon.png (renamed from mitmproxy/libmproxy/web/static/images/chrome-devtools/resourcePlainIcon.png) | bin | 295 -> 295 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/resourceExecutableIcon.png (renamed from mitmproxy/libmproxy/web/static/images/resourceExecutableIcon.png) | bin | 853 -> 853 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/resourceFlashIcon.png (renamed from mitmproxy/libmproxy/web/static/images/resourceFlashIcon.png) | bin | 921 -> 921 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/resourceImageIcon.png (renamed from mitmproxy/libmproxy/web/static/images/resourceImageIcon.png) | bin | 976 -> 976 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/resourceJavaIcon.png (renamed from mitmproxy/libmproxy/web/static/images/resourceJavaIcon.png) | bin | 861 -> 861 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/resourceNotModifiedIcon.png (renamed from mitmproxy/libmproxy/web/static/images/resourceNotModifiedIcon.png) | bin | 1072 -> 1072 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/images/resourceRedirectIcon.png (renamed from mitmproxy/libmproxy/web/static/images/resourceRedirectIcon.png) | bin | 1174 -> 1174 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/vendor.css (renamed from mitmproxy/libmproxy/web/static/vendor.css) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/web/static/vendor.js (renamed from mitmproxy/libmproxy/web/static/vendor.js) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/web/templates/index.html (renamed from mitmproxy/libmproxy/web/templates/index.html) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/webfonts/fontawesome-webfont.eot (renamed from mitmproxy/libmproxy/webfonts/fontawesome-webfont.eot) | bin | 56006 -> 56006 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/webfonts/fontawesome-webfont.svg (renamed from mitmproxy/libmproxy/webfonts/fontawesome-webfont.svg) | 0 | ||||
-rw-r--r-- | mitmproxy/mitmproxy/webfonts/fontawesome-webfont.ttf (renamed from mitmproxy/libmproxy/webfonts/fontawesome-webfont.ttf) | bin | 112160 -> 112160 bytes | |||
-rw-r--r-- | mitmproxy/mitmproxy/webfonts/fontawesome-webfont.woff (renamed from mitmproxy/libmproxy/webfonts/fontawesome-webfont.woff) | bin | 65452 -> 65452 bytes | |||
-rwxr-xr-x | mitmproxy/mitmweb | 4 | ||||
-rw-r--r-- | mitmproxy/setup.py | 8 | ||||
-rw-r--r-- | mitmproxy/web/conf.js | 4 | ||||
-rwxr-xr-x | pathod/.sources/make | 8 | ||||
-rw-r--r-- | pathod/MANIFEST.in | 2 | ||||
-rw-r--r-- | pathod/README.rst | 2 | ||||
-rwxr-xr-x | pathod/bin/pathoc (renamed from pathod/pathoc) | 2 | ||||
-rwxr-xr-x | pathod/bin/pathod (renamed from pathod/pathod) | 2 | ||||
-rw-r--r-- | pathod/examples/libpathod_pathoc.py | 2 | ||||
-rw-r--r-- | pathod/examples/test_context.py | 2 | ||||
-rw-r--r-- | pathod/examples/test_setup.py | 2 | ||||
-rw-r--r-- | pathod/examples/test_setupall.py | 2 | ||||
-rw-r--r-- | pathod/libpathod/templates/libpathod_pathoc.html | 8 | ||||
-rw-r--r-- | pathod/pathod/__init__.py (renamed from pathod/libpathod/__init__.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/app.py (renamed from pathod/libpathod/app.py) | 6 | ||||
-rw-r--r-- | pathod/pathod/language/__init__.py (renamed from pathod/libpathod/language/__init__.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/language/actions.py (renamed from pathod/libpathod/language/actions.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/language/base.py (renamed from pathod/libpathod/language/base.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/language/exceptions.py (renamed from pathod/libpathod/language/exceptions.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/language/generators.py (renamed from pathod/libpathod/language/generators.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/language/http.py (renamed from pathod/libpathod/language/http.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/language/http2.py (renamed from pathod/libpathod/language/http2.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/language/message.py (renamed from pathod/libpathod/language/message.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/language/websockets.py (renamed from pathod/libpathod/language/websockets.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/language/writer.py (renamed from pathod/libpathod/language/writer.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/log.py (renamed from pathod/libpathod/log.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/pathoc.py (renamed from pathod/libpathod/pathoc.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/pathoc_cmdline.py (renamed from pathod/libpathod/pathoc_cmdline.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/pathod.py (renamed from pathod/libpathod/pathod.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/pathod_cmdline.py (renamed from pathod/libpathod/pathod_cmdline.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/protocols/__init__.py (renamed from pathod/libpathod/protocols/__init__.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/protocols/http.py (renamed from pathod/libpathod/protocols/http.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/protocols/http2.py (renamed from pathod/libpathod/protocols/http2.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/protocols/websockets.py (renamed from pathod/libpathod/protocols/websockets.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/static/bootstrap.min.css (renamed from pathod/libpathod/static/bootstrap.min.css) | 0 | ||||
-rw-r--r-- | pathod/pathod/static/bootstrap.min.js (renamed from pathod/libpathod/static/bootstrap.min.js) | 0 | ||||
-rw-r--r-- | pathod/pathod/static/jquery-1.7.2.min.js (renamed from pathod/libpathod/static/jquery-1.7.2.min.js) | 0 | ||||
-rw-r--r-- | pathod/pathod/static/jquery.localscroll-min.js (renamed from pathod/libpathod/static/jquery.localscroll-min.js) | 0 | ||||
-rw-r--r-- | pathod/pathod/static/jquery.scrollTo-min.js (renamed from pathod/libpathod/static/jquery.scrollTo-min.js) | 0 | ||||
-rw-r--r-- | pathod/pathod/static/pathod.css (renamed from pathod/libpathod/static/pathod.css) | 0 | ||||
-rw-r--r-- | pathod/pathod/static/start_quote.png (renamed from pathod/libpathod/static/start_quote.png) | bin | 376 -> 376 bytes | |||
-rw-r--r-- | pathod/pathod/static/syntax.css (renamed from pathod/libpathod/static/syntax.css) | 0 | ||||
-rw-r--r-- | pathod/pathod/static/torture.png (renamed from pathod/libpathod/static/torture.png) | bin | 108327 -> 108327 bytes | |||
-rw-r--r-- | pathod/pathod/templates/about.html (renamed from pathod/libpathod/templates/about.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/docframe.html (renamed from pathod/libpathod/templates/docframe.html) | 4 | ||||
-rw-r--r-- | pathod/pathod/templates/docs_lang.html (renamed from pathod/libpathod/templates/docs_lang.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/docs_lang_requests.html (renamed from pathod/libpathod/templates/docs_lang_requests.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/docs_lang_responses.html (renamed from pathod/libpathod/templates/docs_lang_responses.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/docs_lang_websockets.html (renamed from pathod/libpathod/templates/docs_lang_websockets.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/docs_libpathod.html (renamed from pathod/libpathod/templates/docs_libpathod.html) | 6 | ||||
-rw-r--r-- | pathod/pathod/templates/docs_pathoc.html (renamed from pathod/libpathod/templates/docs_pathoc.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/docs_pathod.html (renamed from pathod/libpathod/templates/docs_pathod.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/docs_test.html (renamed from pathod/libpathod/templates/docs_test.html) | 8 | ||||
-rw-r--r-- | pathod/pathod/templates/download.html (renamed from pathod/libpathod/templates/download.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/examples_context.html (renamed from pathod/libpathod/templates/examples_context.html) | 2 | ||||
-rw-r--r-- | pathod/pathod/templates/examples_setup.html (renamed from pathod/libpathod/templates/examples_setup.html) | 2 | ||||
-rw-r--r-- | pathod/pathod/templates/examples_setupall.html (renamed from pathod/libpathod/templates/examples_setupall.html) | 2 | ||||
-rw-r--r-- | pathod/pathod/templates/frame.html (renamed from pathod/libpathod/templates/frame.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/index.html (renamed from pathod/libpathod/templates/index.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/layout.html (renamed from pathod/libpathod/templates/layout.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/log.html (renamed from pathod/libpathod/templates/log.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/onelog.html (renamed from pathod/libpathod/templates/onelog.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/request_preview.html (renamed from pathod/libpathod/templates/request_preview.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/request_previewform.html (renamed from pathod/libpathod/templates/request_previewform.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/response_preview.html (renamed from pathod/libpathod/templates/response_preview.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/templates/response_previewform.html (renamed from pathod/libpathod/templates/response_previewform.html) | 0 | ||||
-rw-r--r-- | pathod/pathod/test.py (renamed from pathod/libpathod/test.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/utils.py (renamed from pathod/libpathod/utils.py) | 0 | ||||
-rw-r--r-- | pathod/pathod/version.py (renamed from pathod/libpathod/version.py) | 0 | ||||
-rw-r--r-- | pathod/setup.py | 6 | ||||
-rw-r--r-- | pytest.ini | 3 | ||||
-rw-r--r-- | release/mitmdump.spec | 2 | ||||
-rw-r--r-- | release/mitmproxy.spec | 2 | ||||
-rw-r--r-- | release/mitmweb.spec | 2 | ||||
-rw-r--r-- | test/mitmproxy/scripts/concurrent_decorator.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/scripts/concurrent_decorator_err.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_app.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_cmdline.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_console.py | 4 | ||||
-rw-r--r-- | test/mitmproxy/test_console_common.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_console_help.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_console_palettes.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_console_pathedit.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_contentview.py | 4 | ||||
-rw-r--r-- | test/mitmproxy/test_controller.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_custom_contentview.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_dump.py | 10 | ||||
-rw-r--r-- | test/mitmproxy/test_examples.py | 6 | ||||
-rw-r--r-- | test/mitmproxy/test_filt.py | 6 | ||||
-rw-r--r-- | test/mitmproxy/test_flow.py | 20 | ||||
-rw-r--r-- | test/mitmproxy/test_flow_export.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_flow_format_compat.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_fuzzing.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_platform_pf.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/test_protocol_http1.py | 6 | ||||
-rw-r--r-- | test/mitmproxy/test_protocol_http2.py | 6 | ||||
-rw-r--r-- | test/mitmproxy/test_proxy.py | 16 | ||||
-rw-r--r-- | test/mitmproxy/test_script.py | 4 | ||||
-rw-r--r-- | test/mitmproxy/test_server.py | 62 | ||||
-rw-r--r-- | test/mitmproxy/test_utils.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/tools/benchtool.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/tools/inspect_dumpfile.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/tservers.py | 60 | ||||
-rw-r--r-- | test/mitmproxy/tutils.py | 22 | ||||
-rw-r--r-- | test/netlib/http/http2/test_connections.py | 3 | ||||
-rw-r--r-- | test/netlib/test_tcp.py | 3 | ||||
-rw-r--r-- | test/netlib/tservers.py (renamed from netlib/netlib/tservers.py) | 56 | ||||
-rw-r--r-- | test/netlib/websockets/test_websockets.py | 4 | ||||
-rw-r--r-- | test/pathod/test_app.py | 2 | ||||
-rw-r--r-- | test/pathod/test_language_actions.py | 4 | ||||
-rw-r--r-- | test/pathod/test_language_base.py | 4 | ||||
-rw-r--r-- | test/pathod/test_language_generators.py | 2 | ||||
-rw-r--r-- | test/pathod/test_language_http.py | 4 | ||||
-rw-r--r-- | test/pathod/test_language_http2.py | 4 | ||||
-rw-r--r-- | test/pathod/test_language_websocket.py | 4 | ||||
-rw-r--r-- | test/pathod/test_language_writer.py | 4 | ||||
-rw-r--r-- | test/pathod/test_log.py | 2 | ||||
-rw-r--r-- | test/pathod/test_pathoc.py | 2 | ||||
-rw-r--r-- | test/pathod/test_pathoc_cmdline.py | 2 | ||||
-rw-r--r-- | test/pathod/test_pathod.py | 2 | ||||
-rw-r--r-- | test/pathod/test_pathod_cmdline.py | 2 | ||||
-rw-r--r-- | test/pathod/test_test.py | 2 | ||||
-rw-r--r-- | test/pathod/test_utils.py | 2 | ||||
-rw-r--r-- | test/pathod/tutils.py | 2 |
285 files changed, 341 insertions, 346 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 1fc50c51..d4b688e5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -17,7 +17,7 @@ install: - "pip install --user -r requirements.txt" - "python -c \"from OpenSSL import SSL; print(SSL.SSLeay_version(SSL.SSLEAY_VERSION))\"" test_script: - - "py.test -s --cov-config .coveragerc --timeout 30 ./test/" + - "py.test" cache: - C:\Users\appveyor\AppData\Local\pip\cache deploy_script: diff --git a/.coveragerc b/.coveragerc index 627a4110..b62409b6 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,6 @@ [run] branch = True -include = libmproxy netlib libpathod +include = mitmproxy netlib pathod omit = *contrib*, *tnetstring*, *platform*, *console*, *main.py [report] diff --git a/.gitattributes b/.gitattributes index 53ec8dff..c0efd4e4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -mitmproxy/libmproxy/web/static/**/* -diff -mitmproxy/web/src/js/filt/filt.js -diff
\ No newline at end of file +mitmproxy/mitmproxy/web/static/**/* -diff +mitmproxy/web/src/js/filt/filt.js -diff diff --git a/.landscape.yml b/.landscape.yml index 2f7b85e1..1cf78412 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -1,7 +1,7 @@ ignore-paths: - mitmproxy/docs - mitmproxy/examples - - mitmproxy/libmproxy/contrib + - mitmproxy/mitmproxy/contrib - mitmproxy/web max-line-length: 140 pylint: diff --git a/.travis.yml b/.travis.yml index f459dce3..06b31773 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ before_script: - "openssl version -a" script: - - "py.test -s --cov-config .coveragerc --timeout 30 ./test/$SCOPE" + - "py.test ./test/$SCOPE" after_success: - coveralls @@ -72,4 +72,4 @@ cache: directories: - $HOME/.cache/pip - $HOME/.pyenv - - $HOME/Library/Caches/pip
\ No newline at end of file + - $HOME/Library/Caches/pip @@ -53,7 +53,7 @@ mitmproxy test suite: .. code-block:: text . venv/bin/activate # venv\Scripts\activate.bat on Windows - py.test --cov-config .coveragerc test + py.test Note that the main executables for the project - ``mitmdump``, ``mitmproxy``, ``mitmweb``, ``pathod``, and ``pathoc`` - are all created within the virtualenv. After activating the @@ -76,7 +76,7 @@ requirements installed, and you can simply run the test suite: .. code-block:: text - py.test --cov-config .coveragerc test + py.test Please ensure that all patches are accompanied by matching changes in the test suite. The project tries to maintain 100% test coverage. diff --git a/mitmproxy/MANIFEST.in b/mitmproxy/MANIFEST.in index 441fbde8..54b57382 100644 --- a/mitmproxy/MANIFEST.in +++ b/mitmproxy/MANIFEST.in @@ -1,2 +1,2 @@ -graft libmproxy +graft mitmproxy recursive-exclude * *.pyc *.pyo *.swo *.swp *.map
\ No newline at end of file diff --git a/mitmproxy/bin/mitmdump b/mitmproxy/bin/mitmdump new file mode 100644 index 00000000..2483be4f --- /dev/null +++ b/mitmproxy/bin/mitmdump @@ -0,0 +1,3 @@ +#!/usr/bin/env python +from mitmproxy.main import mitmdump +mitmdump() diff --git a/mitmproxy/bin/mitmproxy b/mitmproxy/bin/mitmproxy new file mode 100755 index 00000000..a3d7615d --- /dev/null +++ b/mitmproxy/bin/mitmproxy @@ -0,0 +1,3 @@ +#!/usr/bin/env python +from mitmproxy.main import mitmproxy +mitmproxy() diff --git a/mitmproxy/bin/mitmweb b/mitmproxy/bin/mitmweb new file mode 100755 index 00000000..14188a33 --- /dev/null +++ b/mitmproxy/bin/mitmweb @@ -0,0 +1,4 @@ +#!/usr/bin/env python +from mitmproxy.main import mitmweb + +mitmweb() diff --git a/mitmproxy/docs/Makefile b/mitmproxy/docs/Makefile index 99264d90..74bcda53 100644 --- a/mitmproxy/docs/Makefile +++ b/mitmproxy/docs/Makefile @@ -192,4 +192,4 @@ pseudoxml: @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." livehtml: - sphinx-autobuild -b html -z '../libmproxy' -z '../../netlib/netlib' -r '___jb_(old|bak)___$$' $(ALLSPHINXOPTS) $(BUILDDIR)/html
\ No newline at end of file + sphinx-autobuild -b html -z '../mitmproxy' -z '../../netlib/netlib' -r '___jb_(old|bak)___$$' $(ALLSPHINXOPTS) $(BUILDDIR)/html
\ No newline at end of file diff --git a/mitmproxy/docs/conf.py b/mitmproxy/docs/conf.py index 3ea38e48..01bcce1b 100644 --- a/mitmproxy/docs/conf.py +++ b/mitmproxy/docs/conf.py @@ -21,7 +21,7 @@ import shlex # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) -import libmproxy.version +import mitmproxy.version # -- General configuration ------------------------------------------------ @@ -69,9 +69,9 @@ author = u'The mitmproxy project' # built documents. # # The short X.Y version. -version = libmproxy.version.VERSION +version = mitmproxy.version.VERSION # The full version, including alpha/beta/rc tags. -release = libmproxy.version.VERSION +release = mitmproxy.version.VERSION # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -109,7 +109,7 @@ exclude_patterns = ['_build'] pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. -modindex_common_prefix = ['libmproxy.'] +modindex_common_prefix = ['mitmproxy.'] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False diff --git a/mitmproxy/docs/dev/exceptions.rst b/mitmproxy/docs/dev/exceptions.rst index dab10e74..e890476b 100644 --- a/mitmproxy/docs/dev/exceptions.rst +++ b/mitmproxy/docs/dev/exceptions.rst @@ -3,7 +3,7 @@ Exceptions ========== -.. automodule:: libmproxy.exceptions +.. automodule:: mitmproxy.exceptions :show-inheritance: :members: :undoc-members: diff --git a/mitmproxy/docs/dev/models.rst b/mitmproxy/docs/dev/models.rst index b09c8bae..7a949941 100644 --- a/mitmproxy/docs/dev/models.rst +++ b/mitmproxy/docs/dev/models.rst @@ -54,6 +54,6 @@ Models .. autoclass:: decoded -.. automodule:: libmproxy.models +.. automodule:: mitmproxy.models :show-inheritance: :members: HTTPFlow, Error, ClientConnection, ServerConnection
\ No newline at end of file diff --git a/mitmproxy/docs/dev/protocols.rst b/mitmproxy/docs/dev/protocols.rst index 1f8cca9a..ceb5c2fd 100644 --- a/mitmproxy/docs/dev/protocols.rst +++ b/mitmproxy/docs/dev/protocols.rst @@ -3,7 +3,7 @@ Protocols ========= -.. automodule:: libmproxy.protocol +.. automodule:: mitmproxy.protocol .. autoclass:: Layer :members: diff --git a/mitmproxy/docs/dev/proxy.rst b/mitmproxy/docs/dev/proxy.rst index dbd6fe67..888fb946 100644 --- a/mitmproxy/docs/dev/proxy.rst +++ b/mitmproxy/docs/dev/proxy.rst @@ -3,7 +3,7 @@ Proxy Server ============ -.. automodule:: libmproxy.proxy +.. automodule:: mitmproxy.proxy .. autoclass:: ProxyServer .. autoclass:: DummyServer diff --git a/mitmproxy/docs/dev/testing.rst b/mitmproxy/docs/dev/testing.rst index d7554954..e3b86bf3 100644 --- a/mitmproxy/docs/dev/testing.rst +++ b/mitmproxy/docs/dev/testing.rst @@ -10,7 +10,7 @@ suitable extension to the test suite. Our tests are written for the `py.test`_ or nose_ test frameworks. At the point where you send your pull request, a command like this: ->>> py.test -n 4 --cov libmproxy +>>> py.test -n 4 --cov mitmproxy Should give output something like this: @@ -19,18 +19,18 @@ Should give output something like this: > ---------- coverage: platform darwin, python 2.7.2-final-0 -- > Name Stmts Miss Cover Missing > ---------------------------------------------------- - > libmproxy/__init__ 0 0 100% - > libmproxy/app 4 0 100% - > libmproxy/cmdline 100 0 100% - > libmproxy/controller 69 0 100% - > libmproxy/dump 150 0 100% - > libmproxy/encoding 39 0 100% - > libmproxy/filt 201 0 100% - > libmproxy/flow 891 0 100% - > libmproxy/proxy 427 0 100% - > libmproxy/script 27 0 100% - > libmproxy/utils 133 0 100% - > libmproxy/version 4 0 100% + > mitmproxy/__init__ 0 0 100% + > mitmproxy/app 4 0 100% + > mitmproxy/cmdline 100 0 100% + > mitmproxy/controller 69 0 100% + > mitmproxy/dump 150 0 100% + > mitmproxy/encoding 39 0 100% + > mitmproxy/filt 201 0 100% + > mitmproxy/flow 891 0 100% + > mitmproxy/proxy 427 0 100% + > mitmproxy/script 27 0 100% + > mitmproxy/utils 133 0 100% + > mitmproxy/version 4 0 100% > ---------------------------------------------------- > TOTAL 2045 0 100% > ---------------------------------------------------- diff --git a/mitmproxy/docs/features/filters.rst b/mitmproxy/docs/features/filters.rst index 2adcfb70..509b5d6b 100644 --- a/mitmproxy/docs/features/filters.rst +++ b/mitmproxy/docs/features/filters.rst @@ -8,7 +8,7 @@ Filter expressions consist of the following operators: .. documentedlist:: :header: "Expression" "Description" - :listobject: libmproxy.filt.help + :listobject: mitmproxy.filt.help - Regexes are Python-style - Regexes can be specified as quoted strings diff --git a/mitmproxy/docs/howmitmproxy.rst b/mitmproxy/docs/howmitmproxy.rst index 7dcb4c30..b0b187d3 100644 --- a/mitmproxy/docs/howmitmproxy.rst +++ b/mitmproxy/docs/howmitmproxy.rst @@ -236,4 +236,4 @@ explicit HTTPS connections to establish the CN and SANs, and cope with SNI. .. _Subject Alternative Name: https://en.wikipedia.org/wiki/SubjectAltName .. _iptables: http://www.netfilter.org/ .. _pf: https://en.wikipedia.org/wiki/PF_\(firewall\) -.. _modules: https://github.com/mitmproxy/mitmproxy/tree/master/libmproxy/platform +.. _modules: https://github.com/mitmproxy/mitmproxy/tree/master/mitmproxy/platform diff --git a/mitmproxy/docs/index.rst b/mitmproxy/docs/index.rst index 30fb4027..4bca07d1 100644 --- a/mitmproxy/docs/index.rst +++ b/mitmproxy/docs/index.rst @@ -52,7 +52,7 @@ :caption: Scripting scripting/inlinescripts - scripting/libmproxy + scripting/mitmproxy .. toctree:: diff --git a/mitmproxy/docs/introduction.rst b/mitmproxy/docs/introduction.rst index c8593daf..058f39f9 100644 --- a/mitmproxy/docs/introduction.rst +++ b/mitmproxy/docs/introduction.rst @@ -6,8 +6,6 @@ with a console interface. **mitmdump** is the command-line version of mitmproxy. Think tcpdump for HTTP. -**libmproxy** is the library that mitmproxy and mitmdump are built on. - Documentation, tutorials and distribution packages can be found on the mitmproxy website: `mitmproxy.org <https://mitmproxy.org/>`_ diff --git a/mitmproxy/docs/scripting/inlinescripts.rst b/mitmproxy/docs/scripting/inlinescripts.rst index 27e4abef..89bff2c1 100644 --- a/mitmproxy/docs/scripting/inlinescripts.rst +++ b/mitmproxy/docs/scripting/inlinescripts.rst @@ -16,8 +16,8 @@ client: :language: python The first argument to each event method is an instance of -:py:class:`~libmproxy.script.ScriptContext` that lets the script interact with the global mitmproxy -state. The **response** event also gets an instance of :py:class:`~libmproxy.script.ScriptContext`, +:py:class:`~mitmproxy.script.ScriptContext` that lets the script interact with the global mitmproxy +state. The **response** event also gets an instance of :py:class:`~mitmproxy.script.ScriptContext`, which we can use to manipulate the response itself. We can now run this script using mitmdump or mitmproxy as follows: @@ -37,7 +37,7 @@ Events ------ The ``context`` argument passed to each event method is always a -:py:class:`~libmproxy.script.ScriptContext` instance. It is guaranteed to be the same object +:py:class:`~mitmproxy.script.ScriptContext` instance. It is guaranteed to be the same object for the scripts lifetime and is not shared between multiple inline scripts. You can safely use it to store any form of state you require. @@ -67,7 +67,7 @@ Connection Events :param Layer root_layer: The root layer (see :ref:`protocols` for an explanation what the root layer is), which provides transparent access to all attributes of the - :py:class:`~libmproxy.proxy.RootContext`. For example, ``root_layer.client_conn.address`` + :py:class:`~mitmproxy.proxy.RootContext`. For example, ``root_layer.client_conn.address`` gives the remote address of the connecting client. .. py:function:: clientdisconnect(context, root_layer) @@ -155,32 +155,32 @@ The canonical API documentation is the code, which you can browse here, locally The main classes you will deal with in writing mitmproxy scripts are: -:py:class:`~libmproxy.script.ScriptContext` +:py:class:`~mitmproxy.script.ScriptContext` - A handle for interacting with mitmproxy's Flow Master from within scripts. -:py:class:`~libmproxy.models.ClientConnection` +:py:class:`~mitmproxy.models.ClientConnection` - Describes a client connection. -:py:class:`~libmproxy.models.ServerConnection` +:py:class:`~mitmproxy.models.ServerConnection` - Describes a server connection. -:py:class:`~libmproxy.models.HTTPFlow` +:py:class:`~mitmproxy.models.HTTPFlow` - A collection of objects representing a single HTTP transaction. -:py:class:`~libmproxy.models.HTTPRequest` +:py:class:`~mitmproxy.models.HTTPRequest` - An HTTP request. -:py:class:`~libmproxy.models.HTTPResponse` +:py:class:`~mitmproxy.models.HTTPResponse` - An HTTP response. -:py:class:`~libmproxy.models.Error` +:py:class:`~mitmproxy.models.Error` - A communications error. :py:class:`netlib.http.Headers` - A dictionary-like object for managing HTTP headers. :py:class:`netlib.certutils.SSLCert` - Exposes information SSL certificates. -:py:class:`libmproxy.flow.FlowMaster` - - The "heart" of libmproxy, usually subclassed as :py:class:`libmproxy.dump.DumpMaster` or - :py:class:`libmproxy.console.ConsoleMaster`. +:py:class:`mitmproxy.flow.FlowMaster` + - The "heart" of mitmproxy, usually subclassed as :py:class:`mitmproxy.dump.DumpMaster` or + :py:class:`mitmproxy.console.ConsoleMaster`. Script Context -------------- -.. autoclass:: libmproxy.script.ScriptContext +.. autoclass:: mitmproxy.script.ScriptContext :members: :undoc-members: @@ -189,7 +189,7 @@ Running scripts in parallel We have a single flow primitive, so when a script is blocking, other requests are not processed. While that's usually a very desirable behaviour, blocking scripts can be run threaded by using the -:py:obj:`libmproxy.script.concurrent` decorator. +:py:obj:`mitmproxy.script.concurrent` decorator. **If your script does not block, you should avoid the overhead of the decorator.** .. literalinclude:: ../../examples/nonblocking.py @@ -210,7 +210,7 @@ The arguments are then exposed in the start event: Running scripts on saved flows ------------------------------ -Sometimes, we want to run a script on :py:class:`~libmproxy.models.Flow` objects that are already +Sometimes, we want to run a script on :py:class:`~mitmproxy.models.Flow` objects that are already complete. This happens when you start a script, and then load a saved set of flows from a file (see the "scripted data transformation" example `here <https://mitmproxy.org/doc/mitmdump.html>`_). It also happens when you run a one-shot script on a single flow through the ``|`` (pipe) shortcut diff --git a/mitmproxy/docs/scripting/libmproxy.rst b/mitmproxy/docs/scripting/mitmproxy.rst index 92fa5277..1626eb5a 100644 --- a/mitmproxy/docs/scripting/libmproxy.rst +++ b/mitmproxy/docs/scripting/mitmproxy.rst @@ -1,18 +1,18 @@ -.. _libmproxy: +.. _mitmproxy: -libmproxy +mitmproxy ========= .. note:: - We strongly encourage you to use :ref:`inlinescripts` rather than libmproxy. + We strongly encourage you to use :ref:`inlinescripts` rather than mitmproxy. - Inline Scripts are equally powerful and provide an easier syntax. - Most examples are written as inline scripts. - Multiple inline scripts can be used together. - Inline Scripts can either be executed headless with mitmdump or within the mitmproxy UI. -All of mitmproxy's basic functionality is exposed through the **libmproxy** +All of mitmproxy's basic functionality is exposed through the **mitmproxy** library. The example below shows a simple implementation of the "sticky cookie" functionality included in the interactive mitmproxy program. Traffic is monitored for ``Cookie`` and ``Set-Cookie`` headers, and requests are rewritten diff --git a/mitmproxy/examples/README b/mitmproxy/examples/README index b4dec8e5..cf5c4d7d 100644 --- a/mitmproxy/examples/README +++ b/mitmproxy/examples/README @@ -20,9 +20,9 @@ stub.py Script stub with a method definition for every event. upsidedownternet.py Rewrites traffic to turn images upside down. -# libmproxy examples +# mitmproxy examples flowbasic Basic use of mitmproxy as a library. -stickycookies An example of writing a custom proxy with libmproxy. +stickycookies An example of writing a custom proxy with mitmproxy. # misc diff --git a/mitmproxy/examples/custom_contentviews.py b/mitmproxy/examples/custom_contentviews.py index 17920e51..776ba99d 100644 --- a/mitmproxy/examples/custom_contentviews.py +++ b/mitmproxy/examples/custom_contentviews.py @@ -1,7 +1,7 @@ import string import lxml.html import lxml.etree -from libmproxy import utils, contentviews +from mitmproxy import utils, contentviews class ViewPigLatin(contentviews.View): diff --git a/mitmproxy/examples/filt.py b/mitmproxy/examples/filt.py index d2daf9a2..f99b675c 100644 --- a/mitmproxy/examples/filt.py +++ b/mitmproxy/examples/filt.py @@ -1,7 +1,7 @@ # This scripts demonstrates how to use mitmproxy's filter pattern in inline scripts. # Usage: mitmdump -s "filt.py FILTER" -from libmproxy import filt +from mitmproxy import filt def start(context, argv): diff --git a/mitmproxy/examples/flowbasic b/mitmproxy/examples/flowbasic index 78b9eff7..4a87b86a 100644 --- a/mitmproxy/examples/flowbasic +++ b/mitmproxy/examples/flowbasic @@ -8,8 +8,8 @@ Note that request and response messages are not automatically replied to, so we need to implement handlers to do this. """ -from libmproxy import flow -from libmproxy.proxy import ProxyServer, ProxyConfig +from mitmproxy import flow +from mitmproxy.proxy import ProxyServer, ProxyConfig class MyMaster(flow.FlowMaster): diff --git a/mitmproxy/examples/flowwriter.py b/mitmproxy/examples/flowwriter.py index be2f285e..8fb8cc60 100644 --- a/mitmproxy/examples/flowwriter.py +++ b/mitmproxy/examples/flowwriter.py @@ -1,7 +1,7 @@ import random import sys -from libmproxy.flow import FlowWriter +from mitmproxy.flow import FlowWriter def start(context, argv): diff --git a/mitmproxy/examples/iframe_injector.py b/mitmproxy/examples/iframe_injector.py index 29de9b63..fc38b136 100644 --- a/mitmproxy/examples/iframe_injector.py +++ b/mitmproxy/examples/iframe_injector.py @@ -1,7 +1,7 @@ # Usage: mitmdump -s "iframe_injector.py url" # (this script works best with --anticache) from bs4 import BeautifulSoup -from libmproxy.models import decoded +from mitmproxy.models import decoded def start(context, argv): diff --git a/mitmproxy/examples/modify_response_body.py b/mitmproxy/examples/modify_response_body.py index a35e1525..88f69e15 100644 --- a/mitmproxy/examples/modify_response_body.py +++ b/mitmproxy/examples/modify_response_body.py @@ -1,6 +1,6 @@ # Usage: mitmdump -s "modify_response_body.py mitmproxy bananas" # (this script works best with --anticache) -from libmproxy.models import decoded +from mitmproxy.models import decoded def start(context, argv): diff --git a/mitmproxy/examples/nonblocking.py b/mitmproxy/examples/nonblocking.py index 7bc9c07b..41674b2a 100644 --- a/mitmproxy/examples/nonblocking.py +++ b/mitmproxy/examples/nonblocking.py @@ -1,5 +1,5 @@ import time -from libmproxy.script import concurrent +from mitmproxy.script import concurrent @concurrent # Remove this and see what happens diff --git a/mitmproxy/examples/read_dumpfile b/mitmproxy/examples/read_dumpfile index b329c0e1..56746bb8 100644 --- a/mitmproxy/examples/read_dumpfile +++ b/mitmproxy/examples/read_dumpfile @@ -3,7 +3,7 @@ # Simple script showing how to read a mitmproxy dump file # -from libmproxy import flow +from mitmproxy import flow import pprint import sys diff --git a/mitmproxy/examples/redirect_requests.py b/mitmproxy/examples/redirect_requests.py index a3145083..c0a0ccba 100644 --- a/mitmproxy/examples/redirect_requests.py +++ b/mitmproxy/examples/redirect_requests.py @@ -1,7 +1,7 @@ """ This example shows two ways to redirect flows to other destinations. """ -from libmproxy.models import HTTPResponse +from mitmproxy.models import HTTPResponse from netlib.http import Headers def request(context, flow): diff --git a/mitmproxy/examples/stickycookies b/mitmproxy/examples/stickycookies index 7e84f71c..8f11de8d 100644 --- a/mitmproxy/examples/stickycookies +++ b/mitmproxy/examples/stickycookies @@ -6,8 +6,8 @@ implement functionality similar to the "sticky cookies" option. Heads Up: In the majority of cases, you want to use inline scripts. """ import os -from libmproxy import controller, proxy -from libmproxy.proxy.server import ProxyServer +from mitmproxy import controller, proxy +from mitmproxy.proxy.server import ProxyServer class StickyMaster(controller.Master): diff --git a/mitmproxy/examples/tls_passthrough.py b/mitmproxy/examples/tls_passthrough.py index 0d41b725..8c8fa4eb 100644 --- a/mitmproxy/examples/tls_passthrough.py +++ b/mitmproxy/examples/tls_passthrough.py @@ -26,8 +26,8 @@ import random from enum import Enum -from libmproxy.exceptions import TlsProtocolException -from libmproxy.protocol import TlsLayer, RawTCPLayer +from mitmproxy.exceptions import TlsProtocolException +from mitmproxy.protocol import TlsLayer, RawTCPLayer class InterceptionResult(Enum): diff --git a/mitmproxy/examples/upsidedownternet.py b/mitmproxy/examples/upsidedownternet.py index f2e73047..b7489cb6 100644 --- a/mitmproxy/examples/upsidedownternet.py +++ b/mitmproxy/examples/upsidedownternet.py @@ -1,6 +1,6 @@ import cStringIO from PIL import Image -from libmproxy.models import decoded +from mitmproxy.models import decoded def response(context, flow): diff --git a/mitmproxy/mitmdump b/mitmproxy/mitmdump deleted file mode 100644 index 16087f61..00000000 --- a/mitmproxy/mitmdump +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python -from libmproxy.main import mitmdump -mitmdump() diff --git a/mitmproxy/mitmproxy b/mitmproxy/mitmproxy deleted file mode 100755 index b7c5c94e..00000000 --- a/mitmproxy/mitmproxy +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python -from libmproxy.main import mitmproxy -mitmproxy() diff --git a/mitmproxy/libmproxy/__init__.py b/mitmproxy/mitmproxy/__init__.py index e69de29b..e69de29b 100644 --- a/mitmproxy/libmproxy/__init__.py +++ b/mitmproxy/mitmproxy/__init__.py diff --git a/mitmproxy/libmproxy/cmdline.py b/mitmproxy/mitmproxy/cmdline.py index b1cbfa3a..fedd4f13 100644 --- a/mitmproxy/libmproxy/cmdline.py +++ b/mitmproxy/mitmproxy/cmdline.py @@ -364,7 +364,7 @@ def proxy_options(parser): ) http2 = group.add_mutually_exclusive_group() # !!! - # Watch out: We raise a RuntimeError in libmproxy.proxy.config if http2 is enabled, + # Watch out: We raise a RuntimeError in mitmproxy.proxy.config if http2 is enabled, # but the OpenSSL version does not have ALPN support (which is the default on Ubuntu 14.04). # Do not simply set --http2 as enabled by default. # !!! @@ -642,7 +642,7 @@ def common_options(parser): def mitmproxy(): - # Don't import libmproxy.console for mitmdump, urwid is not available on all + # Don't import mitmproxy.console for mitmdump, urwid is not available on all # platforms. from .console import palettes diff --git a/mitmproxy/libmproxy/console/__init__.py b/mitmproxy/mitmproxy/console/__init__.py index e739ec61..e739ec61 100644 --- a/mitmproxy/libmproxy/console/__init__.py +++ b/mitmproxy/mitmproxy/console/__init__.py diff --git a/mitmproxy/libmproxy/console/common.py b/mitmproxy/mitmproxy/console/common.py index c29ffddc..c29ffddc 100644 --- a/mitmproxy/libmproxy/console/common.py +++ b/mitmproxy/mitmproxy/console/common.py diff --git a/mitmproxy/libmproxy/console/flowdetailview.py b/mitmproxy/mitmproxy/console/flowdetailview.py index f4b4262e..f4b4262e 100644 --- a/mitmproxy/libmproxy/console/flowdetailview.py +++ b/mitmproxy/mitmproxy/console/flowdetailview.py diff --git a/mitmproxy/libmproxy/console/flowlist.py b/mitmproxy/mitmproxy/console/flowlist.py index c2201055..c2201055 100644 --- a/mitmproxy/libmproxy/console/flowlist.py +++ b/mitmproxy/mitmproxy/console/flowlist.py diff --git a/mitmproxy/libmproxy/console/flowview.py b/mitmproxy/mitmproxy/console/flowview.py index d2b98b68..d2b98b68 100644 --- a/mitmproxy/libmproxy/console/flowview.py +++ b/mitmproxy/mitmproxy/console/flowview.py diff --git a/mitmproxy/libmproxy/console/grideditor.py b/mitmproxy/mitmproxy/console/grideditor.py index a11c962c..a11c962c 100644 --- a/mitmproxy/libmproxy/console/grideditor.py +++ b/mitmproxy/mitmproxy/console/grideditor.py diff --git a/mitmproxy/libmproxy/console/help.py b/mitmproxy/mitmproxy/console/help.py index 0c264ebf..0c264ebf 100644 --- a/mitmproxy/libmproxy/console/help.py +++ b/mitmproxy/mitmproxy/console/help.py diff --git a/mitmproxy/libmproxy/console/options.py b/mitmproxy/mitmproxy/console/options.py index 5c9e0cc9..5c9e0cc9 100644 --- a/mitmproxy/libmproxy/console/options.py +++ b/mitmproxy/mitmproxy/console/options.py diff --git a/mitmproxy/libmproxy/console/palettepicker.py b/mitmproxy/mitmproxy/console/palettepicker.py index 51ad0606..51ad0606 100644 --- a/mitmproxy/libmproxy/console/palettepicker.py +++ b/mitmproxy/mitmproxy/console/palettepicker.py diff --git a/mitmproxy/libmproxy/console/palettes.py b/mitmproxy/mitmproxy/console/palettes.py index bd370181..bd370181 100644 --- a/mitmproxy/libmproxy/console/palettes.py +++ b/mitmproxy/mitmproxy/console/palettes.py diff --git a/mitmproxy/libmproxy/console/pathedit.py b/mitmproxy/mitmproxy/console/pathedit.py index 4447070b..4447070b 100644 --- a/mitmproxy/libmproxy/console/pathedit.py +++ b/mitmproxy/mitmproxy/console/pathedit.py diff --git a/mitmproxy/libmproxy/console/searchable.py b/mitmproxy/mitmproxy/console/searchable.py index cff1f0a1..cff1f0a1 100644 --- a/mitmproxy/libmproxy/console/searchable.py +++ b/mitmproxy/mitmproxy/console/searchable.py diff --git a/mitmproxy/libmproxy/console/select.py b/mitmproxy/mitmproxy/console/select.py index 928a7ca5..928a7ca5 100644 --- a/mitmproxy/libmproxy/console/select.py +++ b/mitmproxy/mitmproxy/console/select.py diff --git a/mitmproxy/libmproxy/console/signals.py b/mitmproxy/mitmproxy/console/signals.py index 6a439bf3..6a439bf3 100644 --- a/mitmproxy/libmproxy/console/signals.py +++ b/mitmproxy/mitmproxy/console/signals.py diff --git a/mitmproxy/libmproxy/console/statusbar.py b/mitmproxy/mitmproxy/console/statusbar.py index 4cc63a54..4cc63a54 100644 --- a/mitmproxy/libmproxy/console/statusbar.py +++ b/mitmproxy/mitmproxy/console/statusbar.py diff --git a/mitmproxy/libmproxy/console/tabs.py b/mitmproxy/mitmproxy/console/tabs.py index b5423038..b5423038 100644 --- a/mitmproxy/libmproxy/console/tabs.py +++ b/mitmproxy/mitmproxy/console/tabs.py diff --git a/mitmproxy/libmproxy/console/window.py b/mitmproxy/mitmproxy/console/window.py index 47c284e4..47c284e4 100644 --- a/mitmproxy/libmproxy/console/window.py +++ b/mitmproxy/mitmproxy/console/window.py diff --git a/mitmproxy/libmproxy/contentviews.py b/mitmproxy/mitmproxy/contentviews.py index c0652c18..c0652c18 100644 --- a/mitmproxy/libmproxy/contentviews.py +++ b/mitmproxy/mitmproxy/contentviews.py diff --git a/mitmproxy/libmproxy/contrib/README b/mitmproxy/mitmproxy/contrib/README index e5ce11da..e5ce11da 100644 --- a/mitmproxy/libmproxy/contrib/README +++ b/mitmproxy/mitmproxy/contrib/README diff --git a/mitmproxy/libmproxy/contrib/__init__.py b/mitmproxy/mitmproxy/contrib/__init__.py index e69de29b..e69de29b 100644 --- a/mitmproxy/libmproxy/contrib/__init__.py +++ b/mitmproxy/mitmproxy/contrib/__init__.py diff --git a/mitmproxy/libmproxy/contrib/jsbeautifier/__init__.py b/mitmproxy/mitmproxy/contrib/jsbeautifier/__init__.py index e319e8dd..e319e8dd 100644 --- a/mitmproxy/libmproxy/contrib/jsbeautifier/__init__.py +++ b/mitmproxy/mitmproxy/contrib/jsbeautifier/__init__.py diff --git a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd index e937b762..e937b762 100644 --- a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd +++ b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/README.specs.mkd diff --git a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/__init__.py b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/__init__.py index fcb5b07a..fcb5b07a 100644 --- a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/__init__.py +++ b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/__init__.py diff --git a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/evalbased.py b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/evalbased.py index b17d926e..b17d926e 100644 --- a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/evalbased.py +++ b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/evalbased.py diff --git a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/javascriptobfuscator.py b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/javascriptobfuscator.py index aa4344a3..aa4344a3 100644 --- a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/javascriptobfuscator.py +++ b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/javascriptobfuscator.py diff --git a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/myobfuscate.py b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/myobfuscate.py index 9893f95f..9893f95f 100644 --- a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/myobfuscate.py +++ b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/myobfuscate.py diff --git a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/packer.py b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/packer.py index 4ada669e..4ada669e 100644 --- a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/packer.py +++ b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/packer.py diff --git a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/urlencode.py b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/urlencode.py index 72d2bd1c..72d2bd1c 100644 --- a/mitmproxy/libmproxy/contrib/jsbeautifier/unpackers/urlencode.py +++ b/mitmproxy/mitmproxy/contrib/jsbeautifier/unpackers/urlencode.py diff --git a/mitmproxy/libmproxy/contrib/tls/__init__.py b/mitmproxy/mitmproxy/contrib/tls/__init__.py index 4b540884..4b540884 100644 --- a/mitmproxy/libmproxy/contrib/tls/__init__.py +++ b/mitmproxy/mitmproxy/contrib/tls/__init__.py diff --git a/mitmproxy/libmproxy/contrib/tls/_constructs.py b/mitmproxy/mitmproxy/contrib/tls/_constructs.py index 4cb7d382..4cb7d382 100644 --- a/mitmproxy/libmproxy/contrib/tls/_constructs.py +++ b/mitmproxy/mitmproxy/contrib/tls/_constructs.py diff --git a/mitmproxy/libmproxy/contrib/tls/utils.py b/mitmproxy/mitmproxy/contrib/tls/utils.py index 4c917303..4c917303 100644 --- a/mitmproxy/libmproxy/contrib/tls/utils.py +++ b/mitmproxy/mitmproxy/contrib/tls/utils.py diff --git a/mitmproxy/libmproxy/contrib/wbxml/ASCommandResponse.py b/mitmproxy/mitmproxy/contrib/wbxml/ASCommandResponse.py index 08d03445..08d03445 100644 --- a/mitmproxy/libmproxy/contrib/wbxml/ASCommandResponse.py +++ b/mitmproxy/mitmproxy/contrib/wbxml/ASCommandResponse.py diff --git a/mitmproxy/libmproxy/contrib/wbxml/ASWBXML.py b/mitmproxy/mitmproxy/contrib/wbxml/ASWBXML.py index 926d18c0..926d18c0 100644 --- a/mitmproxy/libmproxy/contrib/wbxml/ASWBXML.py +++ b/mitmproxy/mitmproxy/contrib/wbxml/ASWBXML.py diff --git a/mitmproxy/libmproxy/contrib/wbxml/ASWBXMLByteQueue.py b/mitmproxy/mitmproxy/contrib/wbxml/ASWBXMLByteQueue.py index c7a9e0a5..c7a9e0a5 100644 --- a/mitmproxy/libmproxy/contrib/wbxml/ASWBXMLByteQueue.py +++ b/mitmproxy/mitmproxy/contrib/wbxml/ASWBXMLByteQueue.py diff --git a/mitmproxy/libmproxy/contrib/wbxml/ASWBXMLCodePage.py b/mitmproxy/mitmproxy/contrib/wbxml/ASWBXMLCodePage.py index 2f9d8717..2f9d8717 100644 --- a/mitmproxy/libmproxy/contrib/wbxml/ASWBXMLCodePage.py +++ b/mitmproxy/mitmproxy/contrib/wbxml/ASWBXMLCodePage.py diff --git a/mitmproxy/libmproxy/contrib/wbxml/GlobalTokens.py b/mitmproxy/mitmproxy/contrib/wbxml/GlobalTokens.py index 41310fb1..41310fb1 100644 --- a/mitmproxy/libmproxy/contrib/wbxml/GlobalTokens.py +++ b/mitmproxy/mitmproxy/contrib/wbxml/GlobalTokens.py diff --git a/mitmproxy/libmproxy/contrib/wbxml/InvalidDataException.py b/mitmproxy/mitmproxy/contrib/wbxml/InvalidDataException.py index 67f8ea93..67f8ea93 100644 --- a/mitmproxy/libmproxy/contrib/wbxml/InvalidDataException.py +++ b/mitmproxy/mitmproxy/contrib/wbxml/InvalidDataException.py diff --git a/mitmproxy/libmproxy/contrib/wbxml/__init__.py b/mitmproxy/mitmproxy/contrib/wbxml/__init__.py index e69de29b..e69de29b 100644 --- a/mitmproxy/libmproxy/contrib/wbxml/__init__.py +++ b/mitmproxy/mitmproxy/contrib/wbxml/__init__.py diff --git a/mitmproxy/libmproxy/controller.py b/mitmproxy/mitmproxy/controller.py index 9a059856..9a059856 100644 --- a/mitmproxy/libmproxy/controller.py +++ b/mitmproxy/mitmproxy/controller.py diff --git a/mitmproxy/libmproxy/dump.py b/mitmproxy/mitmproxy/dump.py index 6dab2ddc..6dab2ddc 100644 --- a/mitmproxy/libmproxy/dump.py +++ b/mitmproxy/mitmproxy/dump.py diff --git a/mitmproxy/libmproxy/exceptions.py b/mitmproxy/mitmproxy/exceptions.py index a5d35263..f0ff81a2 100644 --- a/mitmproxy/libmproxy/exceptions.py +++ b/mitmproxy/mitmproxy/exceptions.py @@ -11,7 +11,7 @@ from __future__ import (absolute_import, print_function, division) class ProxyException(Exception): """ - Base class for all exceptions thrown by libmproxy. + Base class for all exceptions thrown by mitmproxy. """ def __init__(self, message=None): diff --git a/mitmproxy/libmproxy/filt.py b/mitmproxy/mitmproxy/filt.py index aa62b717..aa62b717 100644 --- a/mitmproxy/libmproxy/filt.py +++ b/mitmproxy/mitmproxy/filt.py diff --git a/mitmproxy/libmproxy/flow.py b/mitmproxy/mitmproxy/flow.py index ac0d0fbb..ac0d0fbb 100644 --- a/mitmproxy/libmproxy/flow.py +++ b/mitmproxy/mitmproxy/flow.py diff --git a/mitmproxy/libmproxy/flow_export.py b/mitmproxy/mitmproxy/flow_export.py index 52145516..52145516 100644 --- a/mitmproxy/libmproxy/flow_export.py +++ b/mitmproxy/mitmproxy/flow_export.py diff --git a/mitmproxy/libmproxy/flow_format_compat.py b/mitmproxy/mitmproxy/flow_format_compat.py index a7a95af3..a7a95af3 100644 --- a/mitmproxy/libmproxy/flow_format_compat.py +++ b/mitmproxy/mitmproxy/flow_format_compat.py diff --git a/mitmproxy/libmproxy/main.py b/mitmproxy/mitmproxy/main.py index ef135754..ef135754 100644 --- a/mitmproxy/libmproxy/main.py +++ b/mitmproxy/mitmproxy/main.py diff --git a/mitmproxy/libmproxy/models/__init__.py b/mitmproxy/mitmproxy/models/__init__.py index 653b19fd..653b19fd 100644 --- a/mitmproxy/libmproxy/models/__init__.py +++ b/mitmproxy/mitmproxy/models/__init__.py diff --git a/mitmproxy/libmproxy/models/connections.py b/mitmproxy/mitmproxy/models/connections.py index d5920256..d5920256 100644 --- a/mitmproxy/libmproxy/models/connections.py +++ b/mitmproxy/mitmproxy/models/connections.py diff --git a/mitmproxy/libmproxy/models/flow.py b/mitmproxy/mitmproxy/models/flow.py index 10255dad..10255dad 100644 --- a/mitmproxy/libmproxy/models/flow.py +++ b/mitmproxy/mitmproxy/models/flow.py diff --git a/mitmproxy/libmproxy/models/http.py b/mitmproxy/mitmproxy/models/http.py index da9c430e..394fe51a 100644 --- a/mitmproxy/libmproxy/models/http.py +++ b/mitmproxy/mitmproxy/models/http.py @@ -5,10 +5,10 @@ import warnings from email.utils import parsedate_tz, formatdate, mktime_tz import time -from libmproxy import utils from netlib import encoding from netlib.http import status_codes, Headers, Request, Response, decoded from netlib.tcp import Address +from .. import utils from .. import version from .flow import Flow diff --git a/mitmproxy/libmproxy/onboarding/__init__.py b/mitmproxy/mitmproxy/onboarding/__init__.py index e69de29b..e69de29b 100644 --- a/mitmproxy/libmproxy/onboarding/__init__.py +++ b/mitmproxy/mitmproxy/onboarding/__init__.py diff --git a/mitmproxy/libmproxy/onboarding/app.py b/mitmproxy/mitmproxy/onboarding/app.py index ff5ed63c..ff5ed63c 100644 --- a/mitmproxy/libmproxy/onboarding/app.py +++ b/mitmproxy/mitmproxy/onboarding/app.py diff --git a/mitmproxy/libmproxy/onboarding/static/bootstrap.min.css b/mitmproxy/mitmproxy/onboarding/static/bootstrap.min.css index f31489f9..f31489f9 100644 --- a/mitmproxy/libmproxy/onboarding/static/bootstrap.min.css +++ b/mitmproxy/mitmproxy/onboarding/static/bootstrap.min.css diff --git a/mitmproxy/libmproxy/onboarding/static/fontawesome/css/font-awesome.css b/mitmproxy/mitmproxy/onboarding/static/fontawesome/css/font-awesome.css index 048cff97..048cff97 100644 --- a/mitmproxy/libmproxy/onboarding/static/fontawesome/css/font-awesome.css +++ b/mitmproxy/mitmproxy/onboarding/static/fontawesome/css/font-awesome.css diff --git a/mitmproxy/libmproxy/onboarding/static/fontawesome/css/font-awesome.min.css b/mitmproxy/mitmproxy/onboarding/static/fontawesome/css/font-awesome.min.css index 449d6ac5..449d6ac5 100644 --- a/mitmproxy/libmproxy/onboarding/static/fontawesome/css/font-awesome.min.css +++ b/mitmproxy/mitmproxy/onboarding/static/fontawesome/css/font-awesome.min.css diff --git a/mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/FontAwesome.otf b/mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/FontAwesome.otf Binary files differindex 8b0f54e4..8b0f54e4 100644 --- a/mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/FontAwesome.otf +++ b/mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/FontAwesome.otf diff --git a/mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.eot b/mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.eot Binary files differindex 7c79c6a6..7c79c6a6 100644 --- a/mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.eot +++ b/mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.eot diff --git a/mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.svg b/mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.svg index 45fdf338..45fdf338 100644 --- a/mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.svg +++ b/mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.svg diff --git a/mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.ttf b/mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.ttf Binary files differindex e89738de..e89738de 100644 --- a/mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.ttf +++ b/mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.ttf diff --git a/mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.woff b/mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.woff Binary files differindex 8c1748aa..8c1748aa 100644 --- a/mitmproxy/libmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.woff +++ b/mitmproxy/mitmproxy/onboarding/static/fontawesome/fonts/fontawesome-webfont.woff diff --git a/mitmproxy/libmproxy/onboarding/static/mitmproxy.css b/mitmproxy/mitmproxy/onboarding/static/mitmproxy.css index b390976a..b390976a 100644 --- a/mitmproxy/libmproxy/onboarding/static/mitmproxy.css +++ b/mitmproxy/mitmproxy/onboarding/static/mitmproxy.css diff --git a/mitmproxy/libmproxy/onboarding/templates/frame.html b/mitmproxy/mitmproxy/onboarding/templates/frame.html index f00e1a66..f00e1a66 100644 --- a/mitmproxy/libmproxy/onboarding/templates/frame.html +++ b/mitmproxy/mitmproxy/onboarding/templates/frame.html diff --git a/mitmproxy/libmproxy/onboarding/templates/index.html b/mitmproxy/mitmproxy/onboarding/templates/index.html index 1bcff1b8..1bcff1b8 100644 --- a/mitmproxy/libmproxy/onboarding/templates/index.html +++ b/mitmproxy/mitmproxy/onboarding/templates/index.html diff --git a/mitmproxy/libmproxy/onboarding/templates/layout.html b/mitmproxy/mitmproxy/onboarding/templates/layout.html index 8726a788..8726a788 100644 --- a/mitmproxy/libmproxy/onboarding/templates/layout.html +++ b/mitmproxy/mitmproxy/onboarding/templates/layout.html diff --git a/mitmproxy/libmproxy/platform/__init__.py b/mitmproxy/mitmproxy/platform/__init__.py index e1ff7c47..e1ff7c47 100644 --- a/mitmproxy/libmproxy/platform/__init__.py +++ b/mitmproxy/mitmproxy/platform/__init__.py diff --git a/mitmproxy/libmproxy/platform/linux.py b/mitmproxy/mitmproxy/platform/linux.py index 38bfbe42..38bfbe42 100644 --- a/mitmproxy/libmproxy/platform/linux.py +++ b/mitmproxy/mitmproxy/platform/linux.py diff --git a/mitmproxy/libmproxy/platform/osx.py b/mitmproxy/mitmproxy/platform/osx.py index afbc919b..afbc919b 100644 --- a/mitmproxy/libmproxy/platform/osx.py +++ b/mitmproxy/mitmproxy/platform/osx.py diff --git a/mitmproxy/libmproxy/platform/pf.py b/mitmproxy/mitmproxy/platform/pf.py index 97a4c192..97a4c192 100644 --- a/mitmproxy/libmproxy/platform/pf.py +++ b/mitmproxy/mitmproxy/platform/pf.py diff --git a/mitmproxy/libmproxy/platform/windows.py b/mitmproxy/mitmproxy/platform/windows.py index 9fe04cfa..9fe04cfa 100644 --- a/mitmproxy/libmproxy/platform/windows.py +++ b/mitmproxy/mitmproxy/platform/windows.py diff --git a/mitmproxy/libmproxy/protocol/__init__.py b/mitmproxy/mitmproxy/protocol/__init__.py index ea958d06..d44e25e9 100644 --- a/mitmproxy/libmproxy/protocol/__init__.py +++ b/mitmproxy/mitmproxy/protocol/__init__.py @@ -18,7 +18,7 @@ Upgrade request. An actual mitmproxy connection may look as follows (outermost l Every layer acts as a read-only context for its inner layers (see :py:class:`Layer`). To communicate with an outer layer, a layer can use functions provided in the context. The next layer is always -determined by a call to :py:meth:`.next_layer() <libmproxy.proxy.RootContext.next_layer>`, +determined by a call to :py:meth:`.next_layer() <mitmproxy.proxy.RootContext.next_layer>`, which is provided by the root context. Another subtle design goal of this architecture is that upstream connections should be established diff --git a/mitmproxy/libmproxy/protocol/base.py b/mitmproxy/mitmproxy/protocol/base.py index 40fcaf65..a14066cd 100644 --- a/mitmproxy/libmproxy/protocol/base.py +++ b/mitmproxy/mitmproxy/protocol/base.py @@ -19,15 +19,15 @@ class _LayerCodeCompletion(object): if True: return self.config = None - """@type: libmproxy.proxy.ProxyConfig""" + """@type: mitmproxy.proxy.ProxyConfig""" self.client_conn = None - """@type: libmproxy.models.ClientConnection""" + """@type: mitmproxy.models.ClientConnection""" self.server_conn = None - """@type: libmproxy.models.ServerConnection""" + """@type: mitmproxy.models.ServerConnection""" self.channel = None - """@type: libmproxy.controller.Channel""" + """@type: mitmproxy.controller.Channel""" self.ctx = None - """@type: libmproxy.protocol.Layer""" + """@type: mitmproxy.protocol.Layer""" class Layer(_LayerCodeCompletion): @@ -48,9 +48,9 @@ class Layer(_LayerCodeCompletion): sub_layer = Layer(root_layer) print(sub_layer.client_conn) # 42 - The root layer is passed a :py:class:`libmproxy.proxy.RootContext` object, - which provides access to :py:attr:`.client_conn <libmproxy.proxy.RootContext.client_conn>`, - :py:attr:`.next_layer <libmproxy.proxy.RootContext.next_layer>` and other basic attributes. + The root layer is passed a :py:class:`mitmproxy.proxy.RootContext` object, + which provides access to :py:attr:`.client_conn <mitmproxy.proxy.RootContext.client_conn>`, + :py:attr:`.next_layer <mitmproxy.proxy.RootContext.next_layer>` and other basic attributes. Args: ctx: The (read-only) parent layer / context. @@ -70,7 +70,7 @@ class Layer(_LayerCodeCompletion): Once the protocol has finished without exceptions. Raises: - ~libmproxy.exceptions.ProtocolException: if an exception occurs. No other exceptions must be raised. + ~mitmproxy.exceptions.ProtocolException: if an exception occurs. No other exceptions must be raised. """ raise NotImplementedError() @@ -138,7 +138,7 @@ class ServerConnectionMixin(object): Sets a new server address. If there is an existing connection, it will be closed. Raises: - ~libmproxy.exceptions.ProtocolException: + ~mitmproxy.exceptions.ProtocolException: if ``server_tls`` is ``True``, but there was no TLS layer on the protocol stack which could have processed this. """ @@ -171,7 +171,7 @@ class ServerConnectionMixin(object): Must not be called if there is an existing connection. Raises: - ~libmproxy.exceptions.ProtocolException: if the connection could not be established. + ~mitmproxy.exceptions.ProtocolException: if the connection could not be established. """ if not self.server_conn.address: raise ProtocolException("Cannot connect to server, no server address given.") diff --git a/mitmproxy/libmproxy/protocol/http.py b/mitmproxy/mitmproxy/protocol/http.py index 13d7903b..13d7903b 100644 --- a/mitmproxy/libmproxy/protocol/http.py +++ b/mitmproxy/mitmproxy/protocol/http.py diff --git a/mitmproxy/libmproxy/protocol/http1.py b/mitmproxy/mitmproxy/protocol/http1.py index a4cd8801..a4cd8801 100644 --- a/mitmproxy/libmproxy/protocol/http1.py +++ b/mitmproxy/mitmproxy/protocol/http1.py diff --git a/mitmproxy/libmproxy/protocol/http2.py b/mitmproxy/mitmproxy/protocol/http2.py index c121637c..c121637c 100644 --- a/mitmproxy/libmproxy/protocol/http2.py +++ b/mitmproxy/mitmproxy/protocol/http2.py diff --git a/mitmproxy/libmproxy/protocol/http_replay.py b/mitmproxy/mitmproxy/protocol/http_replay.py index 63870dfb..6316f26c 100644 --- a/mitmproxy/libmproxy/protocol/http_replay.py +++ b/mitmproxy/mitmproxy/protocol/http_replay.py @@ -1,7 +1,7 @@ from __future__ import (absolute_import, print_function, division) import threading import traceback -from libmproxy.exceptions import ReplayException +from mitmproxy.exceptions import ReplayException from netlib.exceptions import HttpException, TcpException from netlib.http import http1 @@ -10,7 +10,7 @@ from ..models import Error, HTTPResponse, ServerConnection, make_connect_request from .base import Kill -# TODO: Doesn't really belong into libmproxy.protocol... +# TODO: Doesn't really belong into mitmproxy.protocol... class RequestReplayThread(threading.Thread): diff --git a/mitmproxy/libmproxy/protocol/rawtcp.py b/mitmproxy/mitmproxy/protocol/rawtcp.py index b87899e4..b87899e4 100644 --- a/mitmproxy/libmproxy/protocol/rawtcp.py +++ b/mitmproxy/mitmproxy/protocol/rawtcp.py diff --git a/mitmproxy/libmproxy/protocol/tls.py b/mitmproxy/mitmproxy/protocol/tls.py index 378dd7d4..6913396d 100644 --- a/mitmproxy/libmproxy/protocol/tls.py +++ b/mitmproxy/mitmproxy/protocol/tls.py @@ -227,7 +227,7 @@ def get_client_hello(client_conn): Peek into the socket and read all records that contain the initial client hello message. client_conn: - The :py:class:`client connection <libmproxy.models.ClientConnection>`. + The :py:class:`client connection <mitmproxy.models.ClientConnection>`. Returns: The raw handshake packet bytes, without TLS record header(s). @@ -279,9 +279,9 @@ class TlsClientHello(object): """ Peek into the connection, read the initial client hello and parse it to obtain ALPN values. client_conn: - The :py:class:`client connection <libmproxy.models.ClientConnection>`. + The :py:class:`client connection <mitmproxy.models.ClientConnection>`. Returns: - :py:class:`client hello <libmproxy.protocol.tls.TlsClientHello>`. + :py:class:`client hello <mitmproxy.protocol.tls.TlsClientHello>`. """ try: raw_client_hello = get_client_hello(client_conn)[4:] # exclude handshake header. diff --git a/mitmproxy/libmproxy/proxy/__init__.py b/mitmproxy/mitmproxy/proxy/__init__.py index be7f5207..be7f5207 100644 --- a/mitmproxy/libmproxy/proxy/__init__.py +++ b/mitmproxy/mitmproxy/proxy/__init__.py diff --git a/mitmproxy/libmproxy/proxy/config.py b/mitmproxy/mitmproxy/proxy/config.py index a635ab19..a635ab19 100644 --- a/mitmproxy/libmproxy/proxy/config.py +++ b/mitmproxy/mitmproxy/proxy/config.py diff --git a/mitmproxy/libmproxy/proxy/modes/__init__.py b/mitmproxy/mitmproxy/proxy/modes/__init__.py index f014ed98..f014ed98 100644 --- a/mitmproxy/libmproxy/proxy/modes/__init__.py +++ b/mitmproxy/mitmproxy/proxy/modes/__init__.py diff --git a/mitmproxy/libmproxy/proxy/modes/http_proxy.py b/mitmproxy/mitmproxy/proxy/modes/http_proxy.py index e19062b9..e19062b9 100644 --- a/mitmproxy/libmproxy/proxy/modes/http_proxy.py +++ b/mitmproxy/mitmproxy/proxy/modes/http_proxy.py diff --git a/mitmproxy/libmproxy/proxy/modes/reverse_proxy.py b/mitmproxy/mitmproxy/proxy/modes/reverse_proxy.py index c8e80a10..c8e80a10 100644 --- a/mitmproxy/libmproxy/proxy/modes/reverse_proxy.py +++ b/mitmproxy/mitmproxy/proxy/modes/reverse_proxy.py diff --git a/mitmproxy/libmproxy/proxy/modes/socks_proxy.py b/mitmproxy/mitmproxy/proxy/modes/socks_proxy.py index e2ce44ae..e2ce44ae 100644 --- a/mitmproxy/libmproxy/proxy/modes/socks_proxy.py +++ b/mitmproxy/mitmproxy/proxy/modes/socks_proxy.py diff --git a/mitmproxy/libmproxy/proxy/modes/transparent_proxy.py b/mitmproxy/mitmproxy/proxy/modes/transparent_proxy.py index 3fdda656..3fdda656 100644 --- a/mitmproxy/libmproxy/proxy/modes/transparent_proxy.py +++ b/mitmproxy/mitmproxy/proxy/modes/transparent_proxy.py diff --git a/mitmproxy/libmproxy/proxy/root_context.py b/mitmproxy/mitmproxy/proxy/root_context.py index f56aee6d..ae49523f 100644 --- a/mitmproxy/libmproxy/proxy/root_context.py +++ b/mitmproxy/mitmproxy/proxy/root_context.py @@ -4,7 +4,7 @@ import sys import six -from libmproxy.exceptions import ProtocolException, TlsProtocolException +from mitmproxy.exceptions import ProtocolException, TlsProtocolException from netlib.exceptions import TcpException from ..protocol import ( RawTCPLayer, TlsLayer, Http1Layer, Http2Layer, is_tls_record_magic, ServerConnectionMixin, @@ -21,13 +21,13 @@ class RootContext(object): Attributes: client_conn: - The :py:class:`client connection <libmproxy.models.ClientConnection>`. + The :py:class:`client connection <mitmproxy.models.ClientConnection>`. channel: - A :py:class:`~libmproxy.controller.Channel` to communicate with the FlowMaster. - Provides :py:meth:`.ask() <libmproxy.controller.Channel.ask>` and - :py:meth:`.tell() <libmproxy.controller.Channel.tell>` methods. + A :py:class:`~mitmproxy.controller.Channel` to communicate with the FlowMaster. + Provides :py:meth:`.ask() <mitmproxy.controller.Channel.ask>` and + :py:meth:`.tell() <mitmproxy.controller.Channel.tell>` methods. config: - The :py:class:`proxy server's configuration <libmproxy.proxy.ProxyConfig>` + The :py:class:`proxy server's configuration <mitmproxy.proxy.ProxyConfig>` """ def __init__(self, client_conn, config, channel): diff --git a/mitmproxy/libmproxy/proxy/server.py b/mitmproxy/mitmproxy/proxy/server.py index d208cff5..8b62ff93 100644 --- a/mitmproxy/libmproxy/proxy/server.py +++ b/mitmproxy/mitmproxy/proxy/server.py @@ -68,14 +68,14 @@ class ConnectionHandler(object): def __init__(self, client_conn, client_address, config, channel): self.config = config - """@type: libmproxy.proxy.config.ProxyConfig""" + """@type: mitmproxy.proxy.config.ProxyConfig""" self.client_conn = ClientConnection( client_conn, client_address, None) - """@type: libmproxy.proxy.connection.ClientConnection""" + """@type: mitmproxy.proxy.connection.ClientConnection""" self.channel = channel - """@type: libmproxy.controller.Channel""" + """@type: mitmproxy.controller.Channel""" def _create_root_layer(self): root_context = RootContext( diff --git a/mitmproxy/libmproxy/script/__init__.py b/mitmproxy/mitmproxy/script/__init__.py index 3ee19b04..3ee19b04 100644 --- a/mitmproxy/libmproxy/script/__init__.py +++ b/mitmproxy/mitmproxy/script/__init__.py diff --git a/mitmproxy/libmproxy/script/concurrent.py b/mitmproxy/mitmproxy/script/concurrent.py index f0f5e3cd..f0f5e3cd 100644 --- a/mitmproxy/libmproxy/script/concurrent.py +++ b/mitmproxy/mitmproxy/script/concurrent.py diff --git a/mitmproxy/libmproxy/script/reloader.py b/mitmproxy/mitmproxy/script/reloader.py index b4acf51b..b4acf51b 100644 --- a/mitmproxy/libmproxy/script/reloader.py +++ b/mitmproxy/mitmproxy/script/reloader.py diff --git a/mitmproxy/libmproxy/script/script.py b/mitmproxy/mitmproxy/script/script.py index 55778851..55778851 100644 --- a/mitmproxy/libmproxy/script/script.py +++ b/mitmproxy/mitmproxy/script/script.py diff --git a/mitmproxy/libmproxy/script/script_context.py b/mitmproxy/mitmproxy/script/script_context.py index cd5d4b61..cd5d4b61 100644 --- a/mitmproxy/libmproxy/script/script_context.py +++ b/mitmproxy/mitmproxy/script/script_context.py diff --git a/mitmproxy/libmproxy/stateobject.py b/mitmproxy/mitmproxy/stateobject.py index a4a1ffda..a4a1ffda 100644 --- a/mitmproxy/libmproxy/stateobject.py +++ b/mitmproxy/mitmproxy/stateobject.py diff --git a/mitmproxy/libmproxy/tnetstring.py b/mitmproxy/mitmproxy/tnetstring.py index c5c185c6..c5c185c6 100644 --- a/mitmproxy/libmproxy/tnetstring.py +++ b/mitmproxy/mitmproxy/tnetstring.py diff --git a/mitmproxy/libmproxy/utils.py b/mitmproxy/mitmproxy/utils.py index 4bdd036e..4bdd036e 100644 --- a/mitmproxy/libmproxy/utils.py +++ b/mitmproxy/mitmproxy/utils.py diff --git a/mitmproxy/libmproxy/version.py b/mitmproxy/mitmproxy/version.py index 63f60a8d..63f60a8d 100644 --- a/mitmproxy/libmproxy/version.py +++ b/mitmproxy/mitmproxy/version.py diff --git a/mitmproxy/libmproxy/web/__init__.py b/mitmproxy/mitmproxy/web/__init__.py index 50c49e8d..50c49e8d 100644 --- a/mitmproxy/libmproxy/web/__init__.py +++ b/mitmproxy/mitmproxy/web/__init__.py diff --git a/mitmproxy/libmproxy/web/app.py b/mitmproxy/mitmproxy/web/app.py index 63b7bf1a..63b7bf1a 100644 --- a/mitmproxy/libmproxy/web/app.py +++ b/mitmproxy/mitmproxy/web/app.py diff --git a/mitmproxy/libmproxy/web/static/app.css b/mitmproxy/mitmproxy/web/static/app.css index 94a6abf0..94a6abf0 100644 --- a/mitmproxy/libmproxy/web/static/app.css +++ b/mitmproxy/mitmproxy/web/static/app.css diff --git a/mitmproxy/libmproxy/web/static/app.js b/mitmproxy/mitmproxy/web/static/app.js index 27f356f7..27f356f7 100644 --- a/mitmproxy/libmproxy/web/static/app.js +++ b/mitmproxy/mitmproxy/web/static/app.js diff --git a/mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.eot b/mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.eot Binary files differindex 84677bc0..84677bc0 100644 --- a/mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.eot +++ b/mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.eot diff --git a/mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.svg b/mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.svg index d907b25a..d907b25a 100644 --- a/mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.svg +++ b/mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.svg diff --git a/mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.ttf b/mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.ttf Binary files differindex 96a3639c..96a3639c 100644 --- a/mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.ttf +++ b/mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.ttf diff --git a/mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.woff b/mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.woff Binary files differindex 628b6a52..628b6a52 100644 --- a/mitmproxy/libmproxy/web/static/fonts/fontawesome-webfont.woff +++ b/mitmproxy/mitmproxy/web/static/fonts/fontawesome-webfont.woff diff --git a/mitmproxy/libmproxy/web/static/images/chrome-devtools/LICENSE b/mitmproxy/mitmproxy/web/static/images/chrome-devtools/LICENSE index 6e4f8b9f..6e4f8b9f 100644 --- a/mitmproxy/libmproxy/web/static/images/chrome-devtools/LICENSE +++ b/mitmproxy/mitmproxy/web/static/images/chrome-devtools/LICENSE diff --git a/mitmproxy/libmproxy/web/static/images/chrome-devtools/resourceCSSIcon.png b/mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourceCSSIcon.png Binary files differindex 18828d06..18828d06 100644 --- a/mitmproxy/libmproxy/web/static/images/chrome-devtools/resourceCSSIcon.png +++ b/mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourceCSSIcon.png diff --git a/mitmproxy/libmproxy/web/static/images/chrome-devtools/resourceDocumentIcon.png b/mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourceDocumentIcon.png Binary files differindex fdc10e47..fdc10e47 100644 --- a/mitmproxy/libmproxy/web/static/images/chrome-devtools/resourceDocumentIcon.png +++ b/mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourceDocumentIcon.png diff --git a/mitmproxy/libmproxy/web/static/images/chrome-devtools/resourceJSIcon.png b/mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourceJSIcon.png Binary files differindex c1b72189..c1b72189 100644 --- a/mitmproxy/libmproxy/web/static/images/chrome-devtools/resourceJSIcon.png +++ b/mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourceJSIcon.png diff --git a/mitmproxy/libmproxy/web/static/images/chrome-devtools/resourcePlainIcon.png b/mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourcePlainIcon.png Binary files differindex 8c82a4c7..8c82a4c7 100644 --- a/mitmproxy/libmproxy/web/static/images/chrome-devtools/resourcePlainIcon.png +++ b/mitmproxy/mitmproxy/web/static/images/chrome-devtools/resourcePlainIcon.png diff --git a/mitmproxy/libmproxy/web/static/images/resourceExecutableIcon.png b/mitmproxy/mitmproxy/web/static/images/resourceExecutableIcon.png Binary files differindex fa70c2fd..fa70c2fd 100644 --- a/mitmproxy/libmproxy/web/static/images/resourceExecutableIcon.png +++ b/mitmproxy/mitmproxy/web/static/images/resourceExecutableIcon.png diff --git a/mitmproxy/libmproxy/web/static/images/resourceFlashIcon.png b/mitmproxy/mitmproxy/web/static/images/resourceFlashIcon.png Binary files differindex ead5a4d0..ead5a4d0 100644 --- a/mitmproxy/libmproxy/web/static/images/resourceFlashIcon.png +++ b/mitmproxy/mitmproxy/web/static/images/resourceFlashIcon.png diff --git a/mitmproxy/libmproxy/web/static/images/resourceImageIcon.png b/mitmproxy/mitmproxy/web/static/images/resourceImageIcon.png Binary files differindex 23163042..23163042 100644 --- a/mitmproxy/libmproxy/web/static/images/resourceImageIcon.png +++ b/mitmproxy/mitmproxy/web/static/images/resourceImageIcon.png diff --git a/mitmproxy/libmproxy/web/static/images/resourceJavaIcon.png b/mitmproxy/mitmproxy/web/static/images/resourceJavaIcon.png Binary files differindex 553b3391..553b3391 100644 --- a/mitmproxy/libmproxy/web/static/images/resourceJavaIcon.png +++ b/mitmproxy/mitmproxy/web/static/images/resourceJavaIcon.png diff --git a/mitmproxy/libmproxy/web/static/images/resourceNotModifiedIcon.png b/mitmproxy/mitmproxy/web/static/images/resourceNotModifiedIcon.png Binary files differindex 9c6a879d..9c6a879d 100644 --- a/mitmproxy/libmproxy/web/static/images/resourceNotModifiedIcon.png +++ b/mitmproxy/mitmproxy/web/static/images/resourceNotModifiedIcon.png diff --git a/mitmproxy/libmproxy/web/static/images/resourceRedirectIcon.png b/mitmproxy/mitmproxy/web/static/images/resourceRedirectIcon.png Binary files differindex 58fe3ac1..58fe3ac1 100644 --- a/mitmproxy/libmproxy/web/static/images/resourceRedirectIcon.png +++ b/mitmproxy/mitmproxy/web/static/images/resourceRedirectIcon.png diff --git a/mitmproxy/libmproxy/web/static/vendor.css b/mitmproxy/mitmproxy/web/static/vendor.css index 4ed1f0b8..4ed1f0b8 100644 --- a/mitmproxy/libmproxy/web/static/vendor.css +++ b/mitmproxy/mitmproxy/web/static/vendor.css diff --git a/mitmproxy/libmproxy/web/static/vendor.js b/mitmproxy/mitmproxy/web/static/vendor.js index 59d10445..59d10445 100644 --- a/mitmproxy/libmproxy/web/static/vendor.js +++ b/mitmproxy/mitmproxy/web/static/vendor.js diff --git a/mitmproxy/libmproxy/web/templates/index.html b/mitmproxy/mitmproxy/web/templates/index.html index 5f2c6d5e..5f2c6d5e 100644 --- a/mitmproxy/libmproxy/web/templates/index.html +++ b/mitmproxy/mitmproxy/web/templates/index.html diff --git a/mitmproxy/libmproxy/webfonts/fontawesome-webfont.eot b/mitmproxy/mitmproxy/webfonts/fontawesome-webfont.eot Binary files differindex 84677bc0..84677bc0 100644 --- a/mitmproxy/libmproxy/webfonts/fontawesome-webfont.eot +++ b/mitmproxy/mitmproxy/webfonts/fontawesome-webfont.eot diff --git a/mitmproxy/libmproxy/webfonts/fontawesome-webfont.svg b/mitmproxy/mitmproxy/webfonts/fontawesome-webfont.svg index d907b25a..d907b25a 100644 --- a/mitmproxy/libmproxy/webfonts/fontawesome-webfont.svg +++ b/mitmproxy/mitmproxy/webfonts/fontawesome-webfont.svg diff --git a/mitmproxy/libmproxy/webfonts/fontawesome-webfont.ttf b/mitmproxy/mitmproxy/webfonts/fontawesome-webfont.ttf Binary files differindex 96a3639c..96a3639c 100644 --- a/mitmproxy/libmproxy/webfonts/fontawesome-webfont.ttf +++ b/mitmproxy/mitmproxy/webfonts/fontawesome-webfont.ttf diff --git a/mitmproxy/libmproxy/webfonts/fontawesome-webfont.woff b/mitmproxy/mitmproxy/webfonts/fontawesome-webfont.woff Binary files differindex 628b6a52..628b6a52 100644 --- a/mitmproxy/libmproxy/webfonts/fontawesome-webfont.woff +++ b/mitmproxy/mitmproxy/webfonts/fontawesome-webfont.woff diff --git a/mitmproxy/mitmweb b/mitmproxy/mitmweb deleted file mode 100755 index d709811b..00000000 --- a/mitmproxy/mitmweb +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python -from libmproxy.main import mitmweb - -mitmweb() diff --git a/mitmproxy/setup.py b/mitmproxy/setup.py index 13006752..9d796ebb 100644 --- a/mitmproxy/setup.py +++ b/mitmproxy/setup.py @@ -9,7 +9,7 @@ import sys here = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.join(here, "..", "netlib")) -from libmproxy import version +from mitmproxy import version with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() @@ -45,9 +45,9 @@ setup( include_package_data=True, entry_points={ 'console_scripts': [ - 'mitmproxy = libmproxy.main:mitmproxy', - 'mitmdump = libmproxy.main:mitmdump', - 'mitmweb = libmproxy.main:mitmweb' + 'mitmproxy = mitmproxy.main:mitmproxy', + 'mitmdump = mitmproxy.main:mitmdump', + 'mitmweb = mitmproxy.main:mitmweb' ] }, # https://packaging.python.org/en/latest/requirements/#install-requires diff --git a/mitmproxy/web/conf.js b/mitmproxy/web/conf.js index 7c520973..5867ce45 100644 --- a/mitmproxy/web/conf.js +++ b/mitmproxy/web/conf.js @@ -1,8 +1,8 @@ var conf = { src: "src/", - dist: "../libmproxy/web", - static: "../libmproxy/web/static", + dist: "../mitmproxy/web", + static: "../mitmproxy/web/static", js: { // Don't package these in the vendor distribution vendor_excludes: [ diff --git a/pathod/.sources/make b/pathod/.sources/make index 1c8b1d69..94648859 100755 --- a/pathod/.sources/make +++ b/pathod/.sources/make @@ -1,5 +1,5 @@ #!/bin/sh -pygmentize -f html ../examples/test_context.py > ../libpathod/templates/examples_context.html -pygmentize -f html ../examples/test_setup.py > ../libpathod/templates/examples_setup.html -pygmentize -f html ../examples/test_setupall.py > ../libpathod/templates/examples_setupall.html -pygmentize -f html ../examples/libpathod_pathoc.py > ../libpathod/templates/libpathod_pathoc.html +pygmentize -f html ../examples/test_context.py > ../pathod/templates/examples_context.html +pygmentize -f html ../examples/test_setup.py > ../pathod/templates/examples_setup.html +pygmentize -f html ../examples/test_setupall.py > ../pathod/templates/examples_setupall.html +pygmentize -f html ../examples/pathod_pathoc.py > ../pathod/templates/pathod_pathoc.html diff --git a/pathod/MANIFEST.in b/pathod/MANIFEST.in index fb7b776c..a83fa08f 100644 --- a/pathod/MANIFEST.in +++ b/pathod/MANIFEST.in @@ -1,2 +1,2 @@ -graft libpathod +graft pathod recursive-exclude * *.pyc *.pyo *.swo *.swp *.map
\ No newline at end of file diff --git a/pathod/README.rst b/pathod/README.rst index 5593e053..fbedc5ba 100644 --- a/pathod/README.rst +++ b/pathod/README.rst @@ -8,7 +8,7 @@ clients and servers. The project has three components: - ``pathod``, an pathological HTTP daemon. - ``pathoc``, a perverse HTTP client. -- ``libpathod.test``, an API for easily using pathod and pathoc in unit tests. +- ``pathod.test``, an API for easily using pathod and pathoc in unit tests. Installing ---------- diff --git a/pathod/pathoc b/pathod/bin/pathoc index b3121611..ab62d631 100755 --- a/pathod/pathoc +++ b/pathod/bin/pathoc @@ -1,6 +1,6 @@ #!/usr/bin/env python -from libpathod import pathoc_cmdline as cmdline +from pathod import pathoc_cmdline as cmdline if __name__ == "__main__": cmdline.go_pathoc() diff --git a/pathod/pathod b/pathod/bin/pathod index a79becf1..af0c118b 100755 --- a/pathod/pathod +++ b/pathod/bin/pathod @@ -1,6 +1,6 @@ #!/usr/bin/env python -from libpathod import pathod_cmdline as cmdline +from pathod import pathod_cmdline as cmdline if __name__ == "__main__": cmdline.go_pathod() diff --git a/pathod/examples/libpathod_pathoc.py b/pathod/examples/libpathod_pathoc.py index cf94151b..587c0e4c 100644 --- a/pathod/examples/libpathod_pathoc.py +++ b/pathod/examples/libpathod_pathoc.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from libpathod import pathoc +from pathod import pathoc p = pathoc.Pathoc(("google.com", 80)) p.connect() diff --git a/pathod/examples/test_context.py b/pathod/examples/test_context.py index 7c0386c1..8db4331f 100644 --- a/pathod/examples/test_context.py +++ b/pathod/examples/test_context.py @@ -1,5 +1,5 @@ import requests -from libpathod import test +from pathod import test def test_simple(): diff --git a/pathod/examples/test_setup.py b/pathod/examples/test_setup.py index 6085c98a..5dbc456d 100644 --- a/pathod/examples/test_setup.py +++ b/pathod/examples/test_setup.py @@ -1,5 +1,5 @@ import requests -from libpathod import test +from pathod import test class Test: diff --git a/pathod/examples/test_setupall.py b/pathod/examples/test_setupall.py index f0ba5844..cb84b7b2 100644 --- a/pathod/examples/test_setupall.py +++ b/pathod/examples/test_setupall.py @@ -1,5 +1,5 @@ import requests -from libpathod import test +from pathod import test class Test: diff --git a/pathod/libpathod/templates/libpathod_pathoc.html b/pathod/libpathod/templates/libpathod_pathoc.html deleted file mode 100644 index f5871b16..00000000 --- a/pathod/libpathod/templates/libpathod_pathoc.html +++ /dev/null @@ -1,8 +0,0 @@ -<div class="highlight"><pre><span class="c">#!/usr/bin/env python</span> -<span class="kn">from</span> <span class="nn">libpathod</span> <span class="kn">import</span> <span class="n">pathoc</span> - -<span class="n">p</span> <span class="o">=</span> <span class="n">pathoc</span><span class="o">.</span><span class="n">Pathoc</span><span class="p">((</span><span class="s">"google.com"</span><span class="p">,</span> <span class="mi">80</span><span class="p">))</span> -<span class="n">p</span><span class="o">.</span><span class="n">connect</span><span class="p">()</span> -<span class="k">print</span> <span class="n">p</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s">"get:/"</span><span class="p">)</span> -<span class="k">print</span> <span class="n">p</span><span class="o">.</span><span class="n">request</span><span class="p">(</span><span class="s">"get:/foo"</span><span class="p">)</span> -</pre></div> diff --git a/pathod/libpathod/__init__.py b/pathod/pathod/__init__.py index e69de29b..e69de29b 100644 --- a/pathod/libpathod/__init__.py +++ b/pathod/pathod/__init__.py diff --git a/pathod/libpathod/app.py b/pathod/pathod/app.py index debebaf2..c6b7eabc 100644 --- a/pathod/libpathod/app.py +++ b/pathod/pathod/app.py @@ -86,10 +86,10 @@ def make_app(noapi, debug): "docs_pathoc.html", True, section="docs", subsection="pathoc" ) - @app.route('/docs/libpathod') - def docs_libpathod(): + @app.route('/docs/lib_pathod') + def docs_lib_pathod(): return render( - "docs_libpathod.html", True, section="docs", subsection="libpathod" + "docs_lib_pathod.html", True, section="docs", subsection="pathod" ) @app.route('/docs/test') diff --git a/pathod/libpathod/language/__init__.py b/pathod/pathod/language/__init__.py index 32199e08..32199e08 100644 --- a/pathod/libpathod/language/__init__.py +++ b/pathod/pathod/language/__init__.py diff --git a/pathod/libpathod/language/actions.py b/pathod/pathod/language/actions.py index 34a9bafb..34a9bafb 100644 --- a/pathod/libpathod/language/actions.py +++ b/pathod/pathod/language/actions.py diff --git a/pathod/libpathod/language/base.py b/pathod/pathod/language/base.py index a4302998..a4302998 100644 --- a/pathod/libpathod/language/base.py +++ b/pathod/pathod/language/base.py diff --git a/pathod/libpathod/language/exceptions.py b/pathod/pathod/language/exceptions.py index 84ad3c02..84ad3c02 100644 --- a/pathod/libpathod/language/exceptions.py +++ b/pathod/pathod/language/exceptions.py diff --git a/pathod/libpathod/language/generators.py b/pathod/pathod/language/generators.py index a17e7052..a17e7052 100644 --- a/pathod/libpathod/language/generators.py +++ b/pathod/pathod/language/generators.py diff --git a/pathod/libpathod/language/http.py b/pathod/pathod/language/http.py index a82f12fe..a82f12fe 100644 --- a/pathod/libpathod/language/http.py +++ b/pathod/pathod/language/http.py diff --git a/pathod/libpathod/language/http2.py b/pathod/pathod/language/http2.py index d5e3ca31..d5e3ca31 100644 --- a/pathod/libpathod/language/http2.py +++ b/pathod/pathod/language/http2.py diff --git a/pathod/libpathod/language/message.py b/pathod/pathod/language/message.py index 33124856..33124856 100644 --- a/pathod/libpathod/language/message.py +++ b/pathod/pathod/language/message.py diff --git a/pathod/libpathod/language/websockets.py b/pathod/pathod/language/websockets.py index ea7c870e..ea7c870e 100644 --- a/pathod/libpathod/language/websockets.py +++ b/pathod/pathod/language/websockets.py diff --git a/pathod/libpathod/language/writer.py b/pathod/pathod/language/writer.py index 1a27e1ef..1a27e1ef 100644 --- a/pathod/libpathod/language/writer.py +++ b/pathod/pathod/language/writer.py diff --git a/pathod/libpathod/log.py b/pathod/pathod/log.py index f203542f..f203542f 100644 --- a/pathod/libpathod/log.py +++ b/pathod/pathod/log.py diff --git a/pathod/libpathod/pathoc.py b/pathod/pathod/pathoc.py index c0a33b62..c0a33b62 100644 --- a/pathod/libpathod/pathoc.py +++ b/pathod/pathod/pathoc.py diff --git a/pathod/libpathod/pathoc_cmdline.py b/pathod/pathod/pathoc_cmdline.py index bf827a9a..bf827a9a 100644 --- a/pathod/libpathod/pathoc_cmdline.py +++ b/pathod/pathod/pathoc_cmdline.py diff --git a/pathod/libpathod/pathod.py b/pathod/pathod/pathod.py index 55e75074..55e75074 100644 --- a/pathod/libpathod/pathod.py +++ b/pathod/pathod/pathod.py diff --git a/pathod/libpathod/pathod_cmdline.py b/pathod/pathod/pathod_cmdline.py index c9272249..c9272249 100644 --- a/pathod/libpathod/pathod_cmdline.py +++ b/pathod/pathod/pathod_cmdline.py diff --git a/pathod/libpathod/protocols/__init__.py b/pathod/pathod/protocols/__init__.py index 1a8c7dab..1a8c7dab 100644 --- a/pathod/libpathod/protocols/__init__.py +++ b/pathod/pathod/protocols/__init__.py diff --git a/pathod/libpathod/protocols/http.py b/pathod/pathod/protocols/http.py index 1f1765cb..1f1765cb 100644 --- a/pathod/libpathod/protocols/http.py +++ b/pathod/pathod/protocols/http.py diff --git a/pathod/libpathod/protocols/http2.py b/pathod/pathod/protocols/http2.py index a098a14e..a098a14e 100644 --- a/pathod/libpathod/protocols/http2.py +++ b/pathod/pathod/protocols/http2.py diff --git a/pathod/libpathod/protocols/websockets.py b/pathod/pathod/protocols/websockets.py index 134d27bc..134d27bc 100644 --- a/pathod/libpathod/protocols/websockets.py +++ b/pathod/pathod/protocols/websockets.py diff --git a/pathod/libpathod/static/bootstrap.min.css b/pathod/pathod/static/bootstrap.min.css index 2e79d91a..2e79d91a 100644 --- a/pathod/libpathod/static/bootstrap.min.css +++ b/pathod/pathod/static/bootstrap.min.css diff --git a/pathod/libpathod/static/bootstrap.min.js b/pathod/pathod/static/bootstrap.min.js index 14356981..14356981 100644 --- a/pathod/libpathod/static/bootstrap.min.js +++ b/pathod/pathod/static/bootstrap.min.js diff --git a/pathod/libpathod/static/jquery-1.7.2.min.js b/pathod/pathod/static/jquery-1.7.2.min.js index 16ad06c5..16ad06c5 100644 --- a/pathod/libpathod/static/jquery-1.7.2.min.js +++ b/pathod/pathod/static/jquery-1.7.2.min.js diff --git a/pathod/libpathod/static/jquery.localscroll-min.js b/pathod/pathod/static/jquery.localscroll-min.js index 3f8d64cc..3f8d64cc 100644 --- a/pathod/libpathod/static/jquery.localscroll-min.js +++ b/pathod/pathod/static/jquery.localscroll-min.js diff --git a/pathod/libpathod/static/jquery.scrollTo-min.js b/pathod/pathod/static/jquery.scrollTo-min.js index 7d4001dc..7d4001dc 100644 --- a/pathod/libpathod/static/jquery.scrollTo-min.js +++ b/pathod/pathod/static/jquery.scrollTo-min.js diff --git a/pathod/libpathod/static/pathod.css b/pathod/pathod/static/pathod.css index 8b23b4d5..8b23b4d5 100644 --- a/pathod/libpathod/static/pathod.css +++ b/pathod/pathod/static/pathod.css diff --git a/pathod/libpathod/static/start_quote.png b/pathod/pathod/static/start_quote.png Binary files differindex 8090f6e8..8090f6e8 100644 --- a/pathod/libpathod/static/start_quote.png +++ b/pathod/pathod/static/start_quote.png diff --git a/pathod/libpathod/static/syntax.css b/pathod/pathod/static/syntax.css index e371658a..e371658a 100644 --- a/pathod/libpathod/static/syntax.css +++ b/pathod/pathod/static/syntax.css diff --git a/pathod/libpathod/static/torture.png b/pathod/pathod/static/torture.png Binary files differindex 50e245ea..50e245ea 100644 --- a/pathod/libpathod/static/torture.png +++ b/pathod/pathod/static/torture.png diff --git a/pathod/libpathod/templates/about.html b/pathod/pathod/templates/about.html index 340dc386..340dc386 100644 --- a/pathod/libpathod/templates/about.html +++ b/pathod/pathod/templates/about.html diff --git a/pathod/libpathod/templates/docframe.html b/pathod/pathod/templates/docframe.html index 4cbdeebc..797de20a 100644 --- a/pathod/libpathod/templates/docframe.html +++ b/pathod/pathod/templates/docframe.html @@ -14,8 +14,8 @@ <li {{subs( "pathod")}}><a href="/docs/pathod">pathod</a></li> <li {{subs( "pathoc")}}><a href="/docs/pathoc">pathoc</a></li> <li {{subs( "lang")}}><a href="/docs/language">language</a></li> - <li {{subs( "libpathod")}}><a href="/docs/libpathod">libpathod</a></li> - <li {{subs( "test")}}><a href="/docs/test">libpathod.test</a></li> + <li {{subs( "pathod")}}><a href="/docs/pathod">pathod</a></li> + <li {{subs( "test")}}><a href="/docs/test">pathod.test</a></li> </ul> </div> </div> diff --git a/pathod/libpathod/templates/docs_lang.html b/pathod/pathod/templates/docs_lang.html index a1d22aef..a1d22aef 100644 --- a/pathod/libpathod/templates/docs_lang.html +++ b/pathod/pathod/templates/docs_lang.html diff --git a/pathod/libpathod/templates/docs_lang_requests.html b/pathod/pathod/templates/docs_lang_requests.html index 81aff535..81aff535 100644 --- a/pathod/libpathod/templates/docs_lang_requests.html +++ b/pathod/pathod/templates/docs_lang_requests.html diff --git a/pathod/libpathod/templates/docs_lang_responses.html b/pathod/pathod/templates/docs_lang_responses.html index 9a85ff1a..9a85ff1a 100644 --- a/pathod/libpathod/templates/docs_lang_responses.html +++ b/pathod/pathod/templates/docs_lang_responses.html diff --git a/pathod/libpathod/templates/docs_lang_websockets.html b/pathod/pathod/templates/docs_lang_websockets.html index dd318e0b..dd318e0b 100644 --- a/pathod/libpathod/templates/docs_lang_websockets.html +++ b/pathod/pathod/templates/docs_lang_websockets.html diff --git a/pathod/libpathod/templates/docs_libpathod.html b/pathod/pathod/templates/docs_libpathod.html index 6d504fe5..8eb6846a 100644 --- a/pathod/libpathod/templates/docs_libpathod.html +++ b/pathod/pathod/templates/docs_libpathod.html @@ -1,7 +1,7 @@ {% extends "docframe.html" %} {% block body %} <div class="page-header"> <h1> - libpathod + pathod <small>Using pathod and pathoc in code.</small> </h1> </div> @@ -9,7 +9,7 @@ <div class="row"> <div class="span6"> <p> - Behind the pathod and pathoc command-line tools lurks <b>libpathod</b>, + Behind the pathod and pathoc command-line tools lurks <b>pathod</b>, a powerful library for manipulating and serving HTTP requests and responses. The canonical documentation for the library is in the code, and can be accessed using pydoc. @@ -17,7 +17,7 @@ </div> <div class="span6"> <h1>pathoc</h1> - {% include "libpathod_pathoc.html" %} + {% include "pathod_pathoc.html" %} </div> </div> {% endblock %} diff --git a/pathod/libpathod/templates/docs_pathoc.html b/pathod/pathod/templates/docs_pathoc.html index d38c3a77..d38c3a77 100644 --- a/pathod/libpathod/templates/docs_pathoc.html +++ b/pathod/pathod/templates/docs_pathoc.html diff --git a/pathod/libpathod/templates/docs_pathod.html b/pathod/pathod/templates/docs_pathod.html index 0d0ae933..0d0ae933 100644 --- a/pathod/libpathod/templates/docs_pathod.html +++ b/pathod/pathod/templates/docs_pathod.html diff --git a/pathod/libpathod/templates/docs_test.html b/pathod/pathod/templates/docs_test.html index 0502c984..ecd84bc7 100644 --- a/pathod/libpathod/templates/docs_test.html +++ b/pathod/pathod/templates/docs_test.html @@ -1,12 +1,12 @@ {% extends "docframe.html" %} {% block body %} <div class="page-header"> <h1> - libpathod.test - <small>Using libpathod in unit tests.</small> + pathod.test + <small>Using pathod in unit tests.</small> </h1> </div> -<p>The <b>libpathod.test</b> module is a light, flexible testing layer for HTTP clients. +<p>The <b>pathod.test</b> module is a light, flexible testing layer for HTTP clients. It works by firing up a Pathod instance in a separate thread, letting you use Pathod's full abilities to generate responses, and then query Pathod's internal logs to establish what happened. All the mechanics of startup, shutdown, finding @@ -15,7 +15,7 @@ <p>The canonical docs can be accessed using pydoc: </p> -<pre class="terminal">pydoc libpathod.test</pre> +<pre class="terminal">pydoc pathod.test</pre> <p> The remainder of this page demonstrates some common interaction patterns using diff --git a/pathod/libpathod/templates/download.html b/pathod/pathod/templates/download.html index bd8950e8..bd8950e8 100644 --- a/pathod/libpathod/templates/download.html +++ b/pathod/pathod/templates/download.html diff --git a/pathod/libpathod/templates/examples_context.html b/pathod/pathod/templates/examples_context.html index afb3bd48..20b02c39 100644 --- a/pathod/libpathod/templates/examples_context.html +++ b/pathod/pathod/templates/examples_context.html @@ -1,5 +1,5 @@ <div class="highlight"><pre><span class="kn">import</span> <span class="nn">requests</span> -<span class="kn">from</span> <span class="nn">libpathod</span> <span class="kn">import</span> <span class="n">test</span> +<span class="kn">from</span> <span class="nn">pathod</span> <span class="kn">import</span> <span class="n">test</span> <span class="k">def</span> <span class="nf">test_simple</span><span class="p">():</span> diff --git a/pathod/libpathod/templates/examples_setup.html b/pathod/pathod/templates/examples_setup.html index c2da1cd1..b8419171 100644 --- a/pathod/libpathod/templates/examples_setup.html +++ b/pathod/pathod/templates/examples_setup.html @@ -1,5 +1,5 @@ <div class="highlight"><pre><span class="kn">import</span> <span class="nn">requests</span> -<span class="kn">from</span> <span class="nn">libpathod</span> <span class="kn">import</span> <span class="n">test</span> +<span class="kn">from</span> <span class="nn">pathod</span> <span class="kn">import</span> <span class="n">test</span> <span class="k">class</span> <span class="nc">Test</span><span class="p">:</span> diff --git a/pathod/libpathod/templates/examples_setupall.html b/pathod/pathod/templates/examples_setupall.html index 629d11e0..3308f6cb 100644 --- a/pathod/libpathod/templates/examples_setupall.html +++ b/pathod/pathod/templates/examples_setupall.html @@ -1,5 +1,5 @@ <div class="highlight"><pre><span class="kn">import</span> <span class="nn">requests</span> -<span class="kn">from</span> <span class="nn">libpathod</span> <span class="kn">import</span> <span class="n">test</span> +<span class="kn">from</span> <span class="nn">pathod</span> <span class="kn">import</span> <span class="n">test</span> <span class="k">class</span> <span class="nc">Test</span><span class="p">:</span> diff --git a/pathod/libpathod/templates/frame.html b/pathod/pathod/templates/frame.html index 4223458d..4223458d 100644 --- a/pathod/libpathod/templates/frame.html +++ b/pathod/pathod/templates/frame.html diff --git a/pathod/libpathod/templates/index.html b/pathod/pathod/templates/index.html index a85a4040..a85a4040 100644 --- a/pathod/libpathod/templates/index.html +++ b/pathod/pathod/templates/index.html diff --git a/pathod/libpathod/templates/layout.html b/pathod/pathod/templates/layout.html index af2857b1..af2857b1 100644 --- a/pathod/libpathod/templates/layout.html +++ b/pathod/pathod/templates/layout.html diff --git a/pathod/libpathod/templates/log.html b/pathod/pathod/templates/log.html index b0484cb8..b0484cb8 100644 --- a/pathod/libpathod/templates/log.html +++ b/pathod/pathod/templates/log.html diff --git a/pathod/libpathod/templates/onelog.html b/pathod/pathod/templates/onelog.html index c222ad60..c222ad60 100644 --- a/pathod/libpathod/templates/onelog.html +++ b/pathod/pathod/templates/onelog.html diff --git a/pathod/libpathod/templates/request_preview.html b/pathod/pathod/templates/request_preview.html index 25d73679..25d73679 100644 --- a/pathod/libpathod/templates/request_preview.html +++ b/pathod/pathod/templates/request_preview.html diff --git a/pathod/libpathod/templates/request_previewform.html b/pathod/pathod/templates/request_previewform.html index 91b5598a..91b5598a 100644 --- a/pathod/libpathod/templates/request_previewform.html +++ b/pathod/pathod/templates/request_previewform.html diff --git a/pathod/libpathod/templates/response_preview.html b/pathod/pathod/templates/response_preview.html index bbce6d6c..bbce6d6c 100644 --- a/pathod/libpathod/templates/response_preview.html +++ b/pathod/pathod/templates/response_preview.html diff --git a/pathod/libpathod/templates/response_previewform.html b/pathod/pathod/templates/response_previewform.html index d46043f3..d46043f3 100644 --- a/pathod/libpathod/templates/response_previewform.html +++ b/pathod/pathod/templates/response_previewform.html diff --git a/pathod/libpathod/test.py b/pathod/pathod/test.py index 33a6b763..33a6b763 100644 --- a/pathod/libpathod/test.py +++ b/pathod/pathod/test.py diff --git a/pathod/libpathod/utils.py b/pathod/pathod/utils.py index a1109a3c..a1109a3c 100644 --- a/pathod/libpathod/utils.py +++ b/pathod/pathod/utils.py diff --git a/pathod/libpathod/version.py b/pathod/pathod/version.py index 63f60a8d..63f60a8d 100644 --- a/pathod/libpathod/version.py +++ b/pathod/pathod/version.py diff --git a/pathod/setup.py b/pathod/setup.py index faec47f2..23e26f42 100644 --- a/pathod/setup.py +++ b/pathod/setup.py @@ -9,7 +9,7 @@ import sys here = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.join(here, "..", "netlib")) -from libpathod import version +from pathod import version with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() @@ -42,8 +42,8 @@ setup( include_package_data=True, entry_points={ 'console_scripts': [ - "pathod = libpathod.pathod_cmdline:go_pathod", - "pathoc = libpathod.pathoc_cmdline:go_pathoc" + "pathod = pathod.pathod_cmdline:go_pathod", + "pathoc = pathod.pathoc_cmdline:go_pathoc" ] }, install_requires=[ diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..6efbdeae --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +testpaths = test +addopts = --timeout 30 -s diff --git a/release/mitmdump.spec b/release/mitmdump.spec index a7bca16a..967f5e58 100644 --- a/release/mitmdump.spec +++ b/release/mitmdump.spec @@ -4,7 +4,7 @@ from PyInstaller.utils.hooks import collect_data_files a = Analysis(['../mitmproxy/mitmdump'], binaries=None, - datas=collect_data_files("libmproxy.onboarding"), + datas=collect_data_files("mitmproxy.onboarding"), hiddenimports=[], hookspath=None, runtime_hooks=None, diff --git a/release/mitmproxy.spec b/release/mitmproxy.spec index 7cafadbf..6356b0a6 100644 --- a/release/mitmproxy.spec +++ b/release/mitmproxy.spec @@ -4,7 +4,7 @@ from PyInstaller.utils.hooks import collect_data_files a = Analysis(['../mitmproxy/mitmproxy'], binaries=None, - datas=collect_data_files("libmproxy.onboarding"), + datas=collect_data_files("mitmproxy.onboarding"), hiddenimports=[], hookspath=None, runtime_hooks=None, diff --git a/release/mitmweb.spec b/release/mitmweb.spec index cba9b5cd..e3e634fa 100644 --- a/release/mitmweb.spec +++ b/release/mitmweb.spec @@ -4,7 +4,7 @@ from PyInstaller.utils.hooks import collect_data_files a = Analysis(['../mitmproxy/mitmweb'], binaries=None, - datas=collect_data_files("libmproxy"), + datas=collect_data_files("mitmproxy"), hiddenimports=[], hookspath=None, runtime_hooks=None, diff --git a/test/mitmproxy/scripts/concurrent_decorator.py b/test/mitmproxy/scripts/concurrent_decorator.py index f6feda1d..6651c811 100644 --- a/test/mitmproxy/scripts/concurrent_decorator.py +++ b/test/mitmproxy/scripts/concurrent_decorator.py @@ -1,5 +1,5 @@ import time -from libmproxy.script import concurrent +from mitmproxy.script import concurrent @concurrent diff --git a/test/mitmproxy/scripts/concurrent_decorator_err.py b/test/mitmproxy/scripts/concurrent_decorator_err.py index 00fd8dad..071b8889 100644 --- a/test/mitmproxy/scripts/concurrent_decorator_err.py +++ b/test/mitmproxy/scripts/concurrent_decorator_err.py @@ -1,4 +1,4 @@ -from libmproxy.script import concurrent +from mitmproxy.script import concurrent @concurrent diff --git a/test/mitmproxy/test_app.py b/test/mitmproxy/test_app.py index 577a70a5..8d8ce271 100644 --- a/test/mitmproxy/test_app.py +++ b/test/mitmproxy/test_app.py @@ -1,7 +1,7 @@ from . import tutils, tservers -class TestApp(tservers.HTTPProxTest): +class TestApp(tservers.HTTPProxyTest): def test_basic(self): assert self.app("/").status_code == 200 diff --git a/test/mitmproxy/test_cmdline.py b/test/mitmproxy/test_cmdline.py index 9b3317aa..5a70f3e0 100644 --- a/test/mitmproxy/test_cmdline.py +++ b/test/mitmproxy/test_cmdline.py @@ -1,5 +1,5 @@ import argparse -from libmproxy import cmdline +from mitmproxy import cmdline from . import tutils diff --git a/test/mitmproxy/test_console.py b/test/mitmproxy/test_console.py index e64ed44a..58a812a6 100644 --- a/test/mitmproxy/test_console.py +++ b/test/mitmproxy/test_console.py @@ -1,8 +1,8 @@ import gc import netlib.tutils -from libmproxy import console -from libmproxy.console import common +from mitmproxy import console +from mitmproxy.console import common from . import tutils diff --git a/test/mitmproxy/test_console_common.py b/test/mitmproxy/test_console_common.py index deba5f6c..219200e0 100644 --- a/test/mitmproxy/test_console_common.py +++ b/test/mitmproxy/test_console_common.py @@ -4,7 +4,7 @@ if os.name == "nt": raise SkipTest("Skipped on Windows.") -import libmproxy.console.common as common +import mitmproxy.console.common as common from . import tutils diff --git a/test/mitmproxy/test_console_help.py b/test/mitmproxy/test_console_help.py index f1a71faf..0589bd68 100644 --- a/test/mitmproxy/test_console_help.py +++ b/test/mitmproxy/test_console_help.py @@ -3,7 +3,7 @@ from unittest.case import SkipTest if os.name == "nt": raise SkipTest("Skipped on Windows.") -import libmproxy.console.help as help +import mitmproxy.console.help as help class TestHelp: diff --git a/test/mitmproxy/test_console_palettes.py b/test/mitmproxy/test_console_palettes.py index ac33f83d..b5d84ddd 100644 --- a/test/mitmproxy/test_console_palettes.py +++ b/test/mitmproxy/test_console_palettes.py @@ -2,7 +2,7 @@ import os from unittest.case import SkipTest if os.name == "nt": raise SkipTest("Skipped on Windows.") -import libmproxy.console.palettes as palettes +import mitmproxy.console.palettes as palettes class TestPalette: diff --git a/test/mitmproxy/test_console_pathedit.py b/test/mitmproxy/test_console_pathedit.py index 940351f5..e2c27b7c 100644 --- a/test/mitmproxy/test_console_pathedit.py +++ b/test/mitmproxy/test_console_pathedit.py @@ -1,6 +1,6 @@ import os from os.path import normpath -from libmproxy.console import pathedit +from mitmproxy.console import pathedit from . import tutils diff --git a/test/mitmproxy/test_contentview.py b/test/mitmproxy/test_contentview.py index af80d63a..7f1d735e 100644 --- a/test/mitmproxy/test_contentview.py +++ b/test/mitmproxy/test_contentview.py @@ -1,9 +1,9 @@ -from libmproxy.exceptions import ContentViewException +from mitmproxy.exceptions import ContentViewException from netlib.http import Headers import netlib.utils from netlib import encoding -import libmproxy.contentviews as cv +import mitmproxy.contentviews as cv from . import tutils try: diff --git a/test/mitmproxy/test_controller.py b/test/mitmproxy/test_controller.py index ffc7d433..eb3f7df4 100644 --- a/test/mitmproxy/test_controller.py +++ b/test/mitmproxy/test_controller.py @@ -1,5 +1,5 @@ import mock -from libmproxy import controller +from mitmproxy import controller class TestMaster: diff --git a/test/mitmproxy/test_custom_contentview.py b/test/mitmproxy/test_custom_contentview.py index adc4109b..479b0b43 100644 --- a/test/mitmproxy/test_custom_contentview.py +++ b/test/mitmproxy/test_custom_contentview.py @@ -1,4 +1,4 @@ -import libmproxy.contentviews as cv +import mitmproxy.contentviews as cv from netlib.http import Headers diff --git a/test/mitmproxy/test_dump.py b/test/mitmproxy/test_dump.py index dbd0c653..3588a73f 100644 --- a/test/mitmproxy/test_dump.py +++ b/test/mitmproxy/test_dump.py @@ -1,13 +1,13 @@ import os from cStringIO import StringIO -from libmproxy.exceptions import ContentViewException -from libmproxy.models import HTTPResponse +from mitmproxy.exceptions import ContentViewException +from mitmproxy.models import HTTPResponse import netlib.tutils from netlib.http import CONTENT_MISSING -from libmproxy import dump, flow -from libmproxy.proxy import Log +from mitmproxy import dump, flow +from mitmproxy.proxy import Log from . import tutils import mock @@ -49,7 +49,7 @@ def test_strfuncs(): m.echo_flow(flow) -@mock.patch("libmproxy.contentviews.get_content_view") +@mock.patch("mitmproxy.contentviews.get_content_view") def test_contentview(get_content_view): get_content_view.side_effect = ContentViewException(""), ("x", iter([])) diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py index bb7c596b..6920c8e9 100644 --- a/test/mitmproxy/test_examples.py +++ b/test/mitmproxy/test_examples.py @@ -1,11 +1,11 @@ import glob -from libmproxy import utils, script -from libmproxy.proxy import config +from mitmproxy import utils, script +from mitmproxy.proxy import config from . import tservers def test_load_scripts(): - example_dir = utils.Data("libmproxy").path("../examples") + example_dir = utils.Data("mitmproxy").path("../examples") scripts = glob.glob("%s/*.py" % example_dir) tmaster = tservers.TestMaster(config.ProxyConfig()) diff --git a/test/mitmproxy/test_filt.py b/test/mitmproxy/test_filt.py index e6873c7d..0ea635e7 100644 --- a/test/mitmproxy/test_filt.py +++ b/test/mitmproxy/test_filt.py @@ -1,7 +1,7 @@ import cStringIO -from libmproxy import filt -from libmproxy.models import Error -from libmproxy.models import http +from mitmproxy import filt +from mitmproxy.models import Error +from mitmproxy.models import http from netlib.http import Headers from . import tutils diff --git a/test/mitmproxy/test_flow.py b/test/mitmproxy/test_flow.py index b122489f..a593c8c3 100644 --- a/test/mitmproxy/test_flow.py +++ b/test/mitmproxy/test_flow.py @@ -9,16 +9,16 @@ import mock import netlib.utils from netlib import odict from netlib.http import CONTENT_MISSING, Headers -from libmproxy import filt, controller, tnetstring, flow -from libmproxy.models import Error -from libmproxy.models import Flow -from libmproxy.models import HTTPFlow -from libmproxy.models import HTTPRequest -from libmproxy.models import HTTPResponse -from libmproxy.proxy.config import HostMatcher -from libmproxy.proxy import ProxyConfig -from libmproxy.proxy.server import DummyServer -from libmproxy.models.connections import ClientConnection +from mitmproxy import filt, controller, tnetstring, flow +from mitmproxy.models import Error +from mitmproxy.models import Flow +from mitmproxy.models import HTTPFlow +from mitmproxy.models import HTTPRequest +from mitmproxy.models import HTTPResponse +from mitmproxy.proxy.config import HostMatcher +from mitmproxy.proxy import ProxyConfig +from mitmproxy.proxy.server import DummyServer +from mitmproxy.models.connections import ClientConnection from . import tutils diff --git a/test/mitmproxy/test_flow_export.py b/test/mitmproxy/test_flow_export.py index e5e9c0a3..2dce3fd6 100644 --- a/test/mitmproxy/test_flow_export.py +++ b/test/mitmproxy/test_flow_export.py @@ -1,7 +1,7 @@ from textwrap import dedent import netlib.tutils -from libmproxy import flow_export +from mitmproxy import flow_export from . import tutils req_get = netlib.tutils.treq( diff --git a/test/mitmproxy/test_flow_format_compat.py b/test/mitmproxy/test_flow_format_compat.py index 232f5473..7a0694e1 100644 --- a/test/mitmproxy/test_flow_format_compat.py +++ b/test/mitmproxy/test_flow_format_compat.py @@ -1,4 +1,4 @@ -from libmproxy.flow import FlowReader, FlowReadError +from mitmproxy.flow import FlowReader, FlowReadError from . import tutils diff --git a/test/mitmproxy/test_fuzzing.py b/test/mitmproxy/test_fuzzing.py index cec64f58..27ea36a6 100644 --- a/test/mitmproxy/test_fuzzing.py +++ b/test/mitmproxy/test_fuzzing.py @@ -6,7 +6,7 @@ from . import tservers """ -class TestFuzzy(tservers.HTTPProxTest): +class TestFuzzy(tservers.HTTPProxyTest): def test_idna_err(self): req = r'get:"http://localhost:%s":i10,"\xc6"' diff --git a/test/mitmproxy/test_platform_pf.py b/test/mitmproxy/test_platform_pf.py index 8994ee0d..5082fafb 100644 --- a/test/mitmproxy/test_platform_pf.py +++ b/test/mitmproxy/test_platform_pf.py @@ -1,5 +1,5 @@ import sys -from libmproxy.platform import pf +from mitmproxy.platform import pf from . import tutils diff --git a/test/mitmproxy/test_protocol_http1.py b/test/mitmproxy/test_protocol_http1.py index 13e0eabe..e0a57b4e 100644 --- a/test/mitmproxy/test_protocol_http1.py +++ b/test/mitmproxy/test_protocol_http1.py @@ -11,7 +11,7 @@ class TestHTTPFlow(object): assert repr(f) -class TestInvalidRequests(tservers.HTTPProxTest): +class TestInvalidRequests(tservers.HTTPProxyTest): ssl = True def test_double_connect(self): @@ -28,7 +28,7 @@ class TestInvalidRequests(tservers.HTTPProxTest): assert "Invalid HTTP request form" in r.content -class TestExpectHeader(tservers.HTTPProxTest): +class TestExpectHeader(tservers.HTTPProxyTest): def test_simple(self): client = TCPClient(("127.0.0.1", self.proxy.port)) @@ -55,7 +55,7 @@ class TestExpectHeader(tservers.HTTPProxTest): client.finish() -class TestHeadContentLength(tservers.HTTPProxTest): +class TestHeadContentLength(tservers.HTTPProxyTest): def test_head_content_length(self): p = self.pathoc() diff --git a/test/mitmproxy/test_protocol_http2.py b/test/mitmproxy/test_protocol_http2.py index 6d3bb43f..1da140d8 100644 --- a/test/mitmproxy/test_protocol_http2.py +++ b/test/mitmproxy/test_protocol_http2.py @@ -6,8 +6,8 @@ import traceback import os import tempfile -from libmproxy.proxy.config import ProxyConfig -from libmproxy.cmdline import APP_HOST, APP_PORT +from mitmproxy.proxy.config import ProxyConfig +from mitmproxy.cmdline import APP_HOST, APP_PORT import logging logging.getLogger("hyper.packages.hpack.hpack").setLevel(logging.WARNING) @@ -18,7 +18,7 @@ logging.getLogger("PIL.Image").setLevel(logging.WARNING) logging.getLogger("PIL.PngImagePlugin").setLevel(logging.WARNING) import netlib -from netlib import tservers as netlib_tservers +from ..netlib import tservers as netlib_tservers from netlib.utils import http2_read_raw_frame import h2 diff --git a/test/mitmproxy/test_proxy.py b/test/mitmproxy/test_proxy.py index 27ae70a8..34b75b62 100644 --- a/test/mitmproxy/test_proxy.py +++ b/test/mitmproxy/test_proxy.py @@ -2,13 +2,13 @@ import os import mock from OpenSSL import SSL -from libmproxy import cmdline -from libmproxy.proxy import ProxyConfig -from libmproxy.proxy.config import process_proxy_options -from libmproxy.models.connections import ServerConnection -from libmproxy.proxy.server import DummyServer, ProxyServer, ConnectionHandler +from mitmproxy import cmdline +from mitmproxy.proxy import ProxyConfig +from mitmproxy.proxy.config import process_proxy_options +from mitmproxy.models.connections import ServerConnection +from mitmproxy.proxy.server import DummyServer, ProxyServer, ConnectionHandler from netlib.exceptions import TcpDisconnect -from libpathod import test +from pathod import test from netlib.http import http1 from . import tutils @@ -76,11 +76,11 @@ class TestProcessProxyOptions: with tutils.tmpdir() as cadir: self.assert_noerr("--cadir", cadir) - @mock.patch("libmproxy.platform.resolver", None) + @mock.patch("mitmproxy.platform.resolver", None) def test_no_transparent(self): self.assert_err("transparent mode not supported", "-T") - @mock.patch("libmproxy.platform.resolver") + @mock.patch("mitmproxy.platform.resolver") def test_modes(self, _): self.assert_noerr("-R", "http://localhost") self.assert_err("expected one argument", "-R") diff --git a/test/mitmproxy/test_script.py b/test/mitmproxy/test_script.py index f3a6499e..b827c623 100644 --- a/test/mitmproxy/test_script.py +++ b/test/mitmproxy/test_script.py @@ -1,7 +1,7 @@ import os import time import mock -from libmproxy import script, flow +from mitmproxy import script, flow from . import tutils @@ -68,7 +68,7 @@ def test_concurrent(): fm = flow.FlowMaster(None, s) fm.load_script(tutils.test_data.path("scripts/concurrent_decorator.py")) - with mock.patch("libmproxy.controller.DummyReply.__call__") as m: + with mock.patch("mitmproxy.controller.DummyReply.__call__") as m: f1, f2 = tutils.tflow(), tutils.tflow() t_start = time.time() fm.handle_request(f1) diff --git a/test/mitmproxy/test_server.py b/test/mitmproxy/test_server.py index 1b7e6966..d7b23bbb 100644 --- a/test/mitmproxy/test_server.py +++ b/test/mitmproxy/test_server.py @@ -10,11 +10,11 @@ from netlib import tcp, http, socks from netlib.certutils import SSLCert from netlib.http import authentication, CONTENT_MISSING, http1 from netlib.tutils import raises -from libpathod import pathoc, pathod +from pathod import pathoc, pathod -from libmproxy.proxy.config import HostMatcher -from libmproxy.protocol import Kill -from libmproxy.models import Error, HTTPResponse +from mitmproxy.proxy.config import HostMatcher +from mitmproxy.protocol import Kill +from mitmproxy.models import Error, HTTPResponse from . import tutils, tservers @@ -45,7 +45,7 @@ class CommonMixin: def test_replay(self): assert self.pathod("304").status_code == 304 - if isinstance(self, tservers.HTTPUpstreamProxTest) and self.ssl: + if isinstance(self, tservers.HTTPUpstreamProxyTest) and self.ssl: assert len(self.master.state.view) == 2 else: assert len(self.master.state.view) == 1 @@ -60,7 +60,7 @@ class CommonMixin: l.request.path = "/p/305:d0" rt = self.master.replay_request(l, block=True) assert not rt - if isinstance(self, tservers.HTTPUpstreamProxTest): + if isinstance(self, tservers.HTTPUpstreamProxyTest): assert l.response.status_code == 502 else: assert l.error @@ -72,7 +72,7 @@ class CommonMixin: # SSL with the upstream proxy. rt = self.master.replay_request(l, block=True) assert not rt - if isinstance(self, tservers.HTTPUpstreamProxTest): + if isinstance(self, tservers.HTTPUpstreamProxyTest): assert l.response.status_code == 502 else: assert l.error @@ -202,7 +202,7 @@ class AppMixin: assert "mitmproxy" in ret.content -class TestHTTP(tservers.HTTPProxTest, CommonMixin, AppMixin): +class TestHTTP(tservers.HTTPProxyTest, CommonMixin, AppMixin): def test_app_err(self): p = self.pathoc() @@ -292,7 +292,7 @@ class TestHTTP(tservers.HTTPProxTest, CommonMixin, AppMixin): self.master.unload_scripts() -class TestHTTPAuth(tservers.HTTPProxTest): +class TestHTTPAuth(tservers.HTTPProxyTest): authenticator = http.authentication.BasicProxyAuth( http.authentication.PassManSingleUser( "test", @@ -314,7 +314,7 @@ class TestHTTPAuth(tservers.HTTPProxTest): assert ret.status_code == 202 -class TestHTTPS(tservers.HTTPProxTest, CommonMixin, TcpMixin): +class TestHTTPS(tservers.HTTPProxyTest, CommonMixin, TcpMixin): ssl = True ssloptions = pathod.SSLOptions(request_client_cert=True) @@ -342,7 +342,7 @@ class TestHTTPS(tservers.HTTPProxTest, CommonMixin, TcpMixin): assert p.request("get:/:i0,'invalid\r\n\r\n'").status_code == 400 -class TestHTTPSCertfile(tservers.HTTPProxTest, CommonMixin): +class TestHTTPSCertfile(tservers.HTTPProxyTest, CommonMixin): ssl = True certfile = True @@ -350,7 +350,7 @@ class TestHTTPSCertfile(tservers.HTTPProxTest, CommonMixin): assert self.pathod("304") -class TestHTTPSUpstreamServerVerificationWTrustedCert(tservers.HTTPProxTest): +class TestHTTPSUpstreamServerVerificationWTrustedCert(tservers.HTTPProxyTest): """ Test upstream server certificate verification with a trusted server cert. @@ -377,7 +377,7 @@ class TestHTTPSUpstreamServerVerificationWTrustedCert(tservers.HTTPProxTest): self.pathoc() -class TestHTTPSUpstreamServerVerificationWBadCert(tservers.HTTPProxTest): +class TestHTTPSUpstreamServerVerificationWBadCert(tservers.HTTPProxyTest): """ Test upstream server certificate verification with an untrusted server cert. @@ -416,7 +416,7 @@ class TestHTTPSUpstreamServerVerificationWBadCert(tservers.HTTPProxTest): assert self._request().status_code == 502 -class TestHTTPSNoCommonName(tservers.HTTPProxTest): +class TestHTTPSNoCommonName(tservers.HTTPProxyTest): """ Test what happens if we get a cert without common name back. @@ -433,7 +433,7 @@ class TestHTTPSNoCommonName(tservers.HTTPProxTest): assert f.sslinfo.certchain[0].get_subject().CN == "127.0.0.1" -class TestReverse(tservers.ReverseProxTest, CommonMixin, TcpMixin): +class TestReverse(tservers.ReverseProxyTest, CommonMixin, TcpMixin): reverse = True @@ -475,7 +475,7 @@ class TestSocks5(tservers.SocksModeTest): assert "SOCKS5 mode failure" in f.content -class TestHttps2Http(tservers.ReverseProxTest): +class TestHttps2Http(tservers.ReverseProxyTest): @classmethod def get_proxy_config(cls): @@ -507,7 +507,7 @@ class TestHttps2Http(tservers.ReverseProxTest): assert p.request("get:'/p/200'").status_code == 200 -class TestTransparent(tservers.TransparentProxTest, CommonMixin, TcpMixin): +class TestTransparent(tservers.TransparentProxyTest, CommonMixin, TcpMixin): ssl = False def test_tcp_stream_modify(self): @@ -523,7 +523,7 @@ class TestTransparent(tservers.TransparentProxTest, CommonMixin, TcpMixin): self.master.unload_scripts() -class TestTransparentSSL(tservers.TransparentProxTest, CommonMixin, TcpMixin): +class TestTransparentSSL(tservers.TransparentProxyTest, CommonMixin, TcpMixin): ssl = True def test_sslerr(self): @@ -533,7 +533,7 @@ class TestTransparentSSL(tservers.TransparentProxTest, CommonMixin, TcpMixin): assert r.status_code == 502 -class TestProxy(tservers.HTTPProxTest): +class TestProxy(tservers.HTTPProxyTest): def test_http(self): f = self.pathod("304") @@ -611,7 +611,7 @@ class TestProxy(tservers.HTTPProxTest): assert f.server_conn.address == ("127.0.0.1", self.server.port) -class TestProxySSL(tservers.HTTPProxTest): +class TestProxySSL(tservers.HTTPProxyTest): ssl = True def test_request_ssl_setup_timestamp_presence(self): @@ -644,7 +644,7 @@ class MasterRedirectRequest(tservers.TestMaster): super(MasterRedirectRequest, self).handle_response(f) -class TestRedirectRequest(tservers.HTTPProxTest): +class TestRedirectRequest(tservers.HTTPProxyTest): masterclass = MasterRedirectRequest ssl = True @@ -697,7 +697,7 @@ class MasterStreamRequest(tservers.TestMaster): f.reply() -class TestStreamRequest(tservers.HTTPProxTest): +class TestStreamRequest(tservers.HTTPProxyTest): masterclass = MasterStreamRequest def test_stream_simple(self): @@ -747,7 +747,7 @@ class MasterFakeResponse(tservers.TestMaster): f.reply(resp) -class TestFakeResponse(tservers.HTTPProxTest): +class TestFakeResponse(tservers.HTTPProxyTest): masterclass = MasterFakeResponse def test_fake(self): @@ -755,7 +755,7 @@ class TestFakeResponse(tservers.HTTPProxTest): assert "header-response" in f.headers -class TestServerConnect(tservers.HTTPProxTest): +class TestServerConnect(tservers.HTTPProxyTest): masterclass = MasterFakeResponse no_upstream_cert = True ssl = True @@ -773,7 +773,7 @@ class MasterKillRequest(tservers.TestMaster): f.reply(Kill) -class TestKillRequest(tservers.HTTPProxTest): +class TestKillRequest(tservers.HTTPProxyTest): masterclass = MasterKillRequest def test_kill(self): @@ -789,7 +789,7 @@ class MasterKillResponse(tservers.TestMaster): f.reply(Kill) -class TestKillResponse(tservers.HTTPProxTest): +class TestKillResponse(tservers.HTTPProxyTest): masterclass = MasterKillResponse def test_kill(self): @@ -805,7 +805,7 @@ class EResolver(tservers.TResolver): raise RuntimeError("Could not resolve original destination.") -class TestTransparentResolveError(tservers.TransparentProxTest): +class TestTransparentResolveError(tservers.TransparentProxyTest): resolver = EResolver def test_resolve_error(self): @@ -820,14 +820,14 @@ class MasterIncomplete(tservers.TestMaster): f.reply(resp) -class TestIncompleteResponse(tservers.HTTPProxTest): +class TestIncompleteResponse(tservers.HTTPProxyTest): masterclass = MasterIncomplete def test_incomplete(self): assert self.pathod("200").status_code == 502 -class TestUpstreamProxy(tservers.HTTPUpstreamProxTest, CommonMixin, AppMixin): +class TestUpstreamProxy(tservers.HTTPUpstreamProxyTest, CommonMixin, AppMixin): ssl = False def test_order(self): @@ -849,7 +849,7 @@ class TestUpstreamProxy(tservers.HTTPUpstreamProxTest, CommonMixin, AppMixin): class TestUpstreamProxySSL( - tservers.HTTPUpstreamProxTest, + tservers.HTTPUpstreamProxyTest, CommonMixin, TcpMixin): ssl = True @@ -918,7 +918,7 @@ class TestUpstreamProxySSL( assert self.chain[1].tmaster.state.flow_count() == 1 -class TestProxyChainingSSLReconnect(tservers.HTTPUpstreamProxTest): +class TestProxyChainingSSLReconnect(tservers.HTTPUpstreamProxyTest): ssl = True def test_reconnect(self): diff --git a/test/mitmproxy/test_utils.py b/test/mitmproxy/test_utils.py index 17bf3dbf..ae6369ae 100644 --- a/test/mitmproxy/test_utils.py +++ b/test/mitmproxy/test_utils.py @@ -1,5 +1,5 @@ import json -from libmproxy import utils +from mitmproxy import utils from . import tutils utils.CERT_SLEEP_TIME = 0 diff --git a/test/mitmproxy/tools/benchtool.py b/test/mitmproxy/tools/benchtool.py index a1d80697..17043676 100644 --- a/test/mitmproxy/tools/benchtool.py +++ b/test/mitmproxy/tools/benchtool.py @@ -5,7 +5,7 @@ # - Apache Bench "ab" binary # - pip install click yappi -from libmproxy.main import mitmdump +from mitmproxy.main import mitmdump from os import system from threading import Thread import time diff --git a/test/mitmproxy/tools/inspect_dumpfile.py b/test/mitmproxy/tools/inspect_dumpfile.py index d15e9e8a..b2201f40 100644 --- a/test/mitmproxy/tools/inspect_dumpfile.py +++ b/test/mitmproxy/tools/inspect_dumpfile.py @@ -2,7 +2,7 @@ from pprint import pprint import click -from libmproxy import tnetstring +from mitmproxy import tnetstring def read_tnetstring(input): diff --git a/test/mitmproxy/tservers.py b/test/mitmproxy/tservers.py index dbc9f7d0..b7b5de9e 100644 --- a/test/mitmproxy/tservers.py +++ b/test/mitmproxy/tservers.py @@ -4,12 +4,12 @@ import tempfile import flask import mock -from libmproxy.proxy.config import ProxyConfig -from libmproxy.proxy.server import ProxyServer -import libpathod.test -import libpathod.pathoc -from libmproxy import flow, controller -from libmproxy.cmdline import APP_HOST, APP_PORT +from mitmproxy.proxy.config import ProxyConfig +from mitmproxy.proxy.server import ProxyServer +import pathod.test +import pathod.pathoc +from mitmproxy import flow, controller +from mitmproxy.cmdline import APP_HOST, APP_PORT testapp = flask.Flask(__name__) @@ -79,7 +79,7 @@ class ProxyThread(threading.Thread): self.tmaster.shutdown() -class ProxTestBase(object): +class ProxyTestBase(object): # Test Configuration ssl = None ssloptions = False @@ -89,10 +89,10 @@ class ProxTestBase(object): @classmethod def setup_class(cls): - cls.server = libpathod.test.Daemon( + cls.server = pathod.test.Daemon( ssl=cls.ssl, ssloptions=cls.ssloptions) - cls.server2 = libpathod.test.Daemon( + cls.server2 = pathod.test.Daemon( ssl=cls.ssl, ssloptions=cls.ssloptions) @@ -132,16 +132,16 @@ class ProxTestBase(object): ) -class HTTPProxTest(ProxTestBase): +class HTTPProxyTest(ProxyTestBase): def pathoc_raw(self): - return libpathod.pathoc.Pathoc(("127.0.0.1", self.proxy.port), fp=None) + return pathod.pathoc.Pathoc(("127.0.0.1", self.proxy.port), fp=None) def pathoc(self, sni=None): """ Returns a connected Pathoc instance. """ - p = libpathod.pathoc.Pathoc( + p = pathod.pathoc.Pathoc( ("localhost", self.proxy.port), ssl=self.ssl, sni=sni, fp=None ) if self.ssl: @@ -164,7 +164,7 @@ class HTTPProxTest(ProxTestBase): def app(self, page): if self.ssl: - p = libpathod.pathoc.Pathoc( + p = pathod.pathoc.Pathoc( ("127.0.0.1", self.proxy.port), True, fp=None ) p.connect((APP_HOST, APP_PORT)) @@ -183,16 +183,16 @@ class TResolver: return ("127.0.0.1", self.port) -class TransparentProxTest(ProxTestBase): +class TransparentProxyTest(ProxyTestBase): ssl = None resolver = TResolver @classmethod def setup_class(cls): - super(TransparentProxTest, cls).setup_class() + super(TransparentProxyTest, cls).setup_class() cls._resolver = mock.patch( - "libmproxy.platform.resolver", + "mitmproxy.platform.resolver", new=lambda: cls.resolver(cls.server.port) ) cls._resolver.start() @@ -200,11 +200,11 @@ class TransparentProxTest(ProxTestBase): @classmethod def teardown_class(cls): cls._resolver.stop() - super(TransparentProxTest, cls).teardown_class() + super(TransparentProxyTest, cls).teardown_class() @classmethod def get_proxy_config(cls): - d = ProxTestBase.get_proxy_config() + d = ProxyTestBase.get_proxy_config() d["mode"] = "transparent" return d @@ -224,19 +224,19 @@ class TransparentProxTest(ProxTestBase): """ Returns a connected Pathoc instance. """ - p = libpathod.pathoc.Pathoc( + p = pathod.pathoc.Pathoc( ("localhost", self.proxy.port), ssl=self.ssl, sni=sni, fp=None ) p.connect() return p -class ReverseProxTest(ProxTestBase): +class ReverseProxyTest(ProxyTestBase): ssl = None @classmethod def get_proxy_config(cls): - d = ProxTestBase.get_proxy_config() + d = ProxyTestBase.get_proxy_config() d["upstream_server"] = ( "https" if cls.ssl else "http", ("127.0.0.1", cls.server.port) @@ -248,7 +248,7 @@ class ReverseProxTest(ProxTestBase): """ Returns a connected Pathoc instance. """ - p = libpathod.pathoc.Pathoc( + p = pathod.pathoc.Pathoc( ("localhost", self.proxy.port), ssl=self.ssl, sni=sni, fp=None ) p.connect() @@ -267,16 +267,16 @@ class ReverseProxTest(ProxTestBase): return p.request(q) -class SocksModeTest(HTTPProxTest): +class SocksModeTest(HTTPProxyTest): @classmethod def get_proxy_config(cls): - d = ProxTestBase.get_proxy_config() + d = ProxyTestBase.get_proxy_config() d["mode"] = "socks5" return d -class ChainProxTest(ProxTestBase): +class ChainProxyTest(ProxyTestBase): """ Chain three instances of mitmproxy in a row to test upstream mode. @@ -290,7 +290,7 @@ class ChainProxTest(ProxTestBase): @classmethod def setup_class(cls): cls.chain = [] - super(ChainProxTest, cls).setup_class() + super(ChainProxyTest, cls).setup_class() for _ in range(cls.n): config = ProxyConfig(**cls.get_proxy_config()) tmaster = cls.masterclass(config) @@ -304,19 +304,19 @@ class ChainProxTest(ProxTestBase): @classmethod def teardown_class(cls): - super(ChainProxTest, cls).teardown_class() + super(ChainProxyTest, cls).teardown_class() for proxy in cls.chain: proxy.shutdown() def setup(self): - super(ChainProxTest, self).setup() + super(ChainProxyTest, self).setup() for proxy in self.chain: proxy.tmaster.clear_log() proxy.tmaster.state.clear() @classmethod def get_proxy_config(cls): - d = super(ChainProxTest, cls).get_proxy_config() + d = super(ChainProxyTest, cls).get_proxy_config() if cls.chain: # First proxy is in normal mode. d.update( mode="upstream", @@ -325,5 +325,5 @@ class ChainProxTest(ProxTestBase): return d -class HTTPUpstreamProxTest(ChainProxTest, HTTPProxTest): +class HTTPUpstreamProxyTest(ChainProxyTest, HTTPProxyTest): pass diff --git a/test/mitmproxy/tutils.py b/test/mitmproxy/tutils.py index 2ce0884d..edcdf3e2 100644 --- a/test/mitmproxy/tutils.py +++ b/test/mitmproxy/tutils.py @@ -9,8 +9,8 @@ from contextlib import contextmanager from unittest.case import SkipTest import netlib.tutils -from libmproxy import utils, controller -from libmproxy.models import ( +from mitmproxy import utils, controller +from mitmproxy.models import ( ClientConnection, ServerConnection, Error, HTTPRequest, HTTPResponse, HTTPFlow ) @@ -39,12 +39,12 @@ def skip_appveyor(fn): def tflow(client_conn=True, server_conn=True, req=True, resp=None, err=None): """ - @type client_conn: bool | None | libmproxy.proxy.connection.ClientConnection - @type server_conn: bool | None | libmproxy.proxy.connection.ServerConnection - @type req: bool | None | libmproxy.protocol.http.HTTPRequest - @type resp: bool | None | libmproxy.protocol.http.HTTPResponse - @type err: bool | None | libmproxy.protocol.primitives.Error - @return: bool | None | libmproxy.protocol.http.HTTPFlow + @type client_conn: bool | None | mitmproxy.proxy.connection.ClientConnection + @type server_conn: bool | None | mitmproxy.proxy.connection.ServerConnection + @type req: bool | None | mitmproxy.protocol.http.HTTPRequest + @type resp: bool | None | mitmproxy.protocol.http.HTTPResponse + @type err: bool | None | mitmproxy.protocol.primitives.Error + @return: bool | None | mitmproxy.protocol.http.HTTPFlow """ if client_conn is True: client_conn = tclient_conn() @@ -72,7 +72,7 @@ def tflow(client_conn=True, server_conn=True, req=True, resp=None, err=None): def tclient_conn(): """ - @return: libmproxy.proxy.connection.ClientConnection + @return: mitmproxy.proxy.connection.ClientConnection """ c = ClientConnection.from_state(dict( address=dict(address=("address", 22), use_ipv6=True), @@ -88,7 +88,7 @@ def tclient_conn(): def tserver_conn(): """ - @return: libmproxy.proxy.connection.ServerConnection + @return: mitmproxy.proxy.connection.ServerConnection """ c = ServerConnection.from_state(dict( address=dict(address=("address", 22), use_ipv6=True), @@ -108,7 +108,7 @@ def tserver_conn(): def terr(content="error"): """ - @return: libmproxy.protocol.primitives.Error + @return: mitmproxy.protocol.primitives.Error """ err = Error(content) return err diff --git a/test/netlib/http/http2/test_connections.py b/test/netlib/http/http2/test_connections.py index 8be127e4..c067d487 100644 --- a/test/netlib/http/http2/test_connections.py +++ b/test/netlib/http/http2/test_connections.py @@ -4,11 +4,12 @@ import codecs from hyperframe.frame import * -from netlib import tcp, http, utils, tservers +from netlib import tcp, http, utils from netlib.tutils import raises from netlib.exceptions import TcpDisconnect from netlib.http.http2.connections import HTTP2Protocol, TCPHandler +from ... import tservers class TestTCPHandlerWrapper: def test_wrapped(self): diff --git a/test/netlib/test_tcp.py b/test/netlib/test_tcp.py index 8ae3aa51..e65a2e2f 100644 --- a/test/netlib/test_tcp.py +++ b/test/netlib/test_tcp.py @@ -10,10 +10,11 @@ import mock from OpenSSL import SSL import OpenSSL -from netlib import tcp, certutils, tutils, tservers +from netlib import tcp, certutils, tutils from netlib.exceptions import InvalidCertificateException, TcpReadIncomplete, TlsException, \ TcpTimeout, TcpDisconnect, TcpException, NetlibException +from . import tservers class EchoHandler(tcp.BaseHandler): sni = None diff --git a/netlib/netlib/tservers.py b/test/netlib/tservers.py index 44ef8063..569745e6 100644 --- a/netlib/netlib/tservers.py +++ b/test/netlib/tservers.py @@ -9,7 +9,7 @@ from netlib import tcp from netlib import tutils -class ServerThread(threading.Thread): +class _ServerThread(threading.Thread): def __init__(self, server): self.server = server @@ -22,33 +22,7 @@ class ServerThread(threading.Thread): self.server.shutdown() -class ServerTestBase(object): - ssl = None - handler = None - addr = ("localhost", 0) - - @classmethod - def setup_class(cls): - cls.q = queue.Queue() - s = cls.makeserver() - cls.port = s.address.port - cls.server = ServerThread(s) - cls.server.start() - - @classmethod - def makeserver(cls): - return TServer(cls.ssl, cls.q, cls.handler, cls.addr) - - @classmethod - def teardown_class(cls): - cls.server.shutdown() - - @property - def last_handler(self): - return self.server.server.last_handler - - -class TServer(tcp.TCPServer): +class _TServer(tcp.TCPServer): def __init__(self, ssl, q, handler_klass, addr): """ @@ -107,3 +81,29 @@ class TServer(tcp.TCPServer): s = StringIO() tcp.TCPServer.handle_error(self, connection, client_address, s) self.q.put(s.getvalue()) + + +class ServerTestBase(object): + ssl = None + handler = None + addr = ("localhost", 0) + + @classmethod + def setup_class(cls): + cls.q = queue.Queue() + s = cls.makeserver() + cls.port = s.address.port + cls.server = _ServerThread(s) + cls.server.start() + + @classmethod + def makeserver(cls): + return _TServer(cls.ssl, cls.q, cls.handler, cls.addr) + + @classmethod + def teardown_class(cls): + cls.server.shutdown() + + @property + def last_handler(self): + return self.server.server.last_handler diff --git a/test/netlib/websockets/test_websockets.py b/test/netlib/websockets/test_websockets.py index d53f0d83..a7d782a4 100644 --- a/test/netlib/websockets/test_websockets.py +++ b/test/netlib/websockets/test_websockets.py @@ -2,12 +2,12 @@ import os from netlib.http.http1 import read_response, read_request -from netlib import tcp, websockets, http, tutils, tservers +from netlib import tcp, websockets, http, tutils from netlib.http import status_codes from netlib.tutils import treq - from netlib.exceptions import * +from .. import tservers class WebSocketsEchoHandler(tcp.BaseHandler): diff --git a/test/pathod/test_app.py b/test/pathod/test_app.py index 4536db8e..ac89c44c 100644 --- a/test/pathod/test_app.py +++ b/test/pathod/test_app.py @@ -21,7 +21,7 @@ class TestApp(tutils.DaemonTests): assert self.getpath("/docs/pathod").status_code == 200 assert self.getpath("/docs/pathoc").status_code == 200 assert self.getpath("/docs/language").status_code == 200 - assert self.getpath("/docs/libpathod").status_code == 200 + assert self.getpath("/docs/pathod").status_code == 200 assert self.getpath("/docs/test").status_code == 200 def test_log(self): diff --git a/test/pathod/test_language_actions.py b/test/pathod/test_language_actions.py index 755f0d85..1c404714 100644 --- a/test/pathod/test_language_actions.py +++ b/test/pathod/test_language_actions.py @@ -1,7 +1,7 @@ import cStringIO -from libpathod.language import actions -from libpathod import language +from pathod.language import actions +from pathod import language def parse_request(s): diff --git a/test/pathod/test_language_base.py b/test/pathod/test_language_base.py index b18ee5b2..64d4af1f 100644 --- a/test/pathod/test_language_base.py +++ b/test/pathod/test_language_base.py @@ -1,6 +1,6 @@ import os -from libpathod import language -from libpathod.language import base, exceptions +from pathod import language +from pathod.language import base, exceptions import tutils diff --git a/test/pathod/test_language_generators.py b/test/pathod/test_language_generators.py index 945560c3..0fceae85 100644 --- a/test/pathod/test_language_generators.py +++ b/test/pathod/test_language_generators.py @@ -1,6 +1,6 @@ import os -from libpathod.language import generators +from pathod.language import generators import tutils diff --git a/test/pathod/test_language_http.py b/test/pathod/test_language_http.py index 26bb6a45..fd60c9fd 100644 --- a/test/pathod/test_language_http.py +++ b/test/pathod/test_language_http.py @@ -1,7 +1,7 @@ import cStringIO -from libpathod import language -from libpathod.language import http, base +from pathod import language +from pathod.language import http, base import tutils diff --git a/test/pathod/test_language_http2.py b/test/pathod/test_language_http2.py index 9be49452..8e9f188c 100644 --- a/test/pathod/test_language_http2.py +++ b/test/pathod/test_language_http2.py @@ -4,8 +4,8 @@ import netlib from netlib import tcp from netlib.http import user_agents -from libpathod import language -from libpathod.language import http2, base +from pathod import language +from pathod.language import http2, base import tutils diff --git a/test/pathod/test_language_websocket.py b/test/pathod/test_language_websocket.py index d98fd33e..f1105dfe 100644 --- a/test/pathod/test_language_websocket.py +++ b/test/pathod/test_language_websocket.py @@ -1,6 +1,6 @@ -from libpathod import language -from libpathod.language import websockets +from pathod import language +from pathod.language import websockets import netlib.websockets import tutils diff --git a/test/pathod/test_language_writer.py b/test/pathod/test_language_writer.py index 1a532903..1a4ac954 100644 --- a/test/pathod/test_language_writer.py +++ b/test/pathod/test_language_writer.py @@ -1,7 +1,7 @@ import cStringIO -from libpathod import language -from libpathod.language import writer +from pathod import language +from pathod.language import writer def test_send_chunk(): diff --git a/test/pathod/test_log.py b/test/pathod/test_log.py index 8f38c040..d91b8bb1 100644 --- a/test/pathod/test_log.py +++ b/test/pathod/test_log.py @@ -1,5 +1,5 @@ import StringIO -from libpathod import log +from pathod import log from netlib.exceptions import TcpDisconnect import netlib.tcp diff --git a/test/pathod/test_pathoc.py b/test/pathod/test_pathoc.py index 7c912773..23edd1d1 100644 --- a/test/pathod/test_pathoc.py +++ b/test/pathod/test_pathoc.py @@ -9,7 +9,7 @@ from netlib import tcp, http, socks from netlib.exceptions import HttpException, TcpException, NetlibException from netlib.http import http1, http2 -from libpathod import pathoc, test, version, pathod, language +from pathod import pathoc, test, version, pathod, language from netlib.tutils import raises import tutils diff --git a/test/pathod/test_pathoc_cmdline.py b/test/pathod/test_pathoc_cmdline.py index 74dfef57..ab1438d1 100644 --- a/test/pathod/test_pathoc_cmdline.py +++ b/test/pathod/test_pathoc_cmdline.py @@ -1,4 +1,4 @@ -from libpathod import pathoc_cmdline as cmdline +from pathod import pathoc_cmdline as cmdline import tutils import cStringIO import mock diff --git a/test/pathod/test_pathod.py b/test/pathod/test_pathod.py index 6d1df74f..f8eb55f9 100644 --- a/test/pathod/test_pathod.py +++ b/test/pathod/test_pathod.py @@ -3,7 +3,7 @@ import cStringIO import OpenSSL import pytest -from libpathod import pathod, version +from pathod import pathod, version from netlib import tcp, http from netlib.exceptions import HttpException, TlsException import tutils diff --git a/test/pathod/test_pathod_cmdline.py b/test/pathod/test_pathod_cmdline.py index 829c4b32..d156bf50 100644 --- a/test/pathod/test_pathod_cmdline.py +++ b/test/pathod/test_pathod_cmdline.py @@ -1,4 +1,4 @@ -from libpathod import pathod_cmdline as cmdline +from pathod import pathod_cmdline as cmdline import tutils import cStringIO import mock diff --git a/test/pathod/test_test.py b/test/pathod/test_test.py index bd92d864..cee286a4 100644 --- a/test/pathod/test_test.py +++ b/test/pathod/test_test.py @@ -1,6 +1,6 @@ import logging import requests -from libpathod import test +from pathod import test import tutils logging.disable(logging.CRITICAL) diff --git a/test/pathod/test_utils.py b/test/pathod/test_utils.py index 7d24e9e4..4dcedf6e 100644 --- a/test/pathod/test_utils.py +++ b/test/pathod/test_utils.py @@ -1,4 +1,4 @@ -from libpathod import utils +from pathod import utils import tutils diff --git a/test/pathod/tutils.py b/test/pathod/tutils.py index 664cdd52..abe7a59b 100644 --- a/test/pathod/tutils.py +++ b/test/pathod/tutils.py @@ -6,7 +6,7 @@ import cStringIO from contextlib import contextmanager import netlib -from libpathod import utils, test, pathoc, pathod, language +from pathod import utils, test, pathoc, pathod, language from netlib import tcp import requests |