Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match requests and serve directories of files stored on the local file system (AutoResponder) #4003

Open
squizzdev opened this issue May 17, 2020 · 1 comment
Labels
kind/feature New features / enhancements

Comments

@squizzdev
Copy link

squizzdev commented May 17, 2020

Our company is moving from Windows to Debian, and previously us developers were using Fiddler's (AutoResponder) feature to capture browser requests for javascript, css etc... and instead serve local copies of files stored in the same relative structure on our local computers (such as in a git repository). This is very helpful when we need to debug UI issues occurring in web pages and data served from our production websites, since we could load the same html pages and ajax requests from the remote server, but load the js and css files stored on our local machine across any web browsers.

For example, we'd have a rule:
Match: https://www.example.com/static-file-assets/*
Serve: file:///path/to/my/coding/repository/static-file-assets/[matched_relative_path]

So this rule could then match a URL such as:
URL: https://www.example.com/static-file-assets/css/styles.css
Return: file:///path/to/my/coding/repository/static-file-assets/css/styles.css

As well as:
URL: https://www.example.com/static-file-assets/js/core/utils.js
Return: file:///path/to/my/coding/repository/static-file-assets/js/core/utils.js

So I'm wondering whether mitmproxy supports this same AutoResponder capability, such as through an addon or script, where it's able to match a certain URL path, then instead serve files stored locally with the same matched relative path?

Having this one feature will enable us to get rid of Fiddler and transition to mitmproxy.

@squizzdev squizzdev added the kind/feature New features / enhancements label May 17, 2020
@squizzdev squizzdev changed the title Match requests for serving directories of files stored on the local file system (AutoResponder) Match requests and serve directories of files stored on the local file system (AutoResponder) May 17, 2020
@mhils
Copy link
Member

mhils commented May 17, 2020

Thanks for the detailed explanation, this is very helpful! 😃

We've already discussed this in #3948.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New features / enhancements
Projects
None yet
Development

No branches or pull requests

2 participants