DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

How does AI transform chaos engineering from an experiment into a critical capability? Learn how to effectively operationalize the chaos.

Data quality isn't just a technical issue: It impacts an organization's compliance, operational efficiency, and customer satisfaction.

Are you a front-end or full-stack developer frustrated by front-end distractions? Learn to move forward with tooling and clear boundaries.

Developer Experience: Demand to support engineering teams has risen, and there is a shift from traditional DevOps to workflow improvements.

Related

  • Your Network, Your Rules: Take Charge With Own DNS
  • Understanding DNS Records: What They Are and Why They Matter
  • Dynamic File Upload Component in Salesforce LWC
  • Introduction to Salesforce Batch Apex [Video]

Trending

  • Kung Fu Commands: Shifu Teaches Po the Command Pattern with Java Functional Interfaces
  • Designing AI Multi-Agent Systems in Java
  • The Rise of Self‐Service Platforms: How Cloud Development Environments Are Reshaping Dev Culture
  • Safeguarding Cloud Databases: Best Practices and Risks Engineers Must Avoid

How to Record HTTP/HTTPS Traffic With mitmproxy

Learn how to get started with mitmproxy, a proxy recorder that can provide record-and-play functionality for use in mobile performance engineering.

By 
Canberk Akduygu user avatar
Canberk Akduygu
·
May. 31, 18 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
34.0K Views

Join the DZone community and get the full member experience.

Join For Free

Mobile performance engineering projects often require record and play functionality. JMeter has a very good Proxy Recorder, but there are other tools to help you overcome the challenges. One of these tools is mitmproxy.

Mitmproxy is a lightweight, fully capable proxy recorder. It has an interactive console and many functionalities to explore. We’ll do some basic stuff as an entry level tutorial.

How to Install mitmproxy

You can use the below command to install it.

 brew install mitmproxy 

It will download and install all the dependencies in a minute.

How to Start mitmproxy

Open a terminal screen. Enter “mitmproxy” and you’ll be welcomed by this screen.

As you can see, mitmproxy started listening to your request by its default port which is 8080. You can change the port with the below command.

 mitmproxy --listen--port #PORTNO 


Configure Your Mobile Device for Proxy

  • Your mobile device needs to be on the same wireless network.
  • Install mitmproxy’s certificate into your mobile device to capture HTTPS traffic.
  • Set your mobile device's proxy settings as described in this blog post.
  • Do any operation you want and get the recording.

  • You can navigate the request by using up and down arrow buttons on your keyboard.
  • You can enter one request’s detail by clicking on it.

Some Useful Commands

Writing the Output to a File

In the recording screen, press e, then select raw. It will ask you the location. Enter the location and anything related to that request (headers, body data, path, etc.)  will be saved into a file.

Return to the Main Console

Press : and write "console.view.pop." You’ll be directed back to the main console.

Clear Recording

Just click “z” to clear the mitmproxy console.

Replay the Request

Just click “r” to replay the request from the proxy.

There are many more commands that you can explore. Just type mitmproxy –commands before starting and browse all the commands.

Happy recording and load testing!

Record (computer science)

Published at DZone with permission of Canberk Akduygu. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Your Network, Your Rules: Take Charge With Own DNS
  • Understanding DNS Records: What They Are and Why They Matter
  • Dynamic File Upload Component in Salesforce LWC
  • Introduction to Salesforce Batch Apex [Video]

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: