Skip to content

Intercept requests based on context paths#10

Merged
erickjung merged 7 commits intoFarfetch:masterfrom
guilherme-fh:master
Nov 3, 2021
Merged

Intercept requests based on context paths#10
erickjung merged 7 commits intoFarfetch:masterfrom
guilherme-fh:master

Conversation

@guilherme-fh
Copy link
Contributor

@guilherme-fh guilherme-fh commented Oct 27, 2021

PR Details

Up until now the mitmproxy was intercepting all network traffic which caused issues when trying to perform other network activities with Mockingbird activated.

With these changes, we'll leverage the --allow-hosts option to solely intercept requests with the path for the context selected. This will allow any user to use internet freely on their device when filtering requests according to their request

Description

  • Adds mitm-on.sh script to start the mitmdump_mb executable with the --allow-hosts option depending on the selected context status
  • Removes filtering performed on ContextManager (no longer needed since this is being done at the mitmproxy level
  • Adds label to alert the user to disable the Server before changing the context
  • Removes ProcessObject and runAsync since we're no longer launching executables directly from the source code

Motivation and Context

In our teams, a painpoint that we felt a lot was the loss of all network connection when we simply wanted to intercept requests based on a determined context.

How Has This Been Tested

After applying these changes, I ran the Mockingbird app several times with no context applied or with context applied (with single or multiple paths). While in the first scenario all traffic is targeted and any activity using internet traffic is halted, in the second scenario only the traffic that is targeted by the context is intercepted and the user can work with the remaining activities.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

Disclaimer

By sending us your contributions, you are agreeing that your contribution is made subject to the terms of our Contributor Ownership Statement

@erickjung erickjung merged commit f5cca2c into Farfetch:master Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants