---
title: How to record HTTP/HTTPS traffic with mitmproxy?
description: Loadium blog
image: https://cdn-images-1.medium.com/max/2560/1*YtZkNSsKb6l6z1hwtIa6Pw.jpeg
---

[Skip to content](https://explore.loadium.com/loadium-blog/best-practices-for-api-security-testing-1-0-0-0-0-0-0-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-1756-edabd5f6#main-content)

 Sep 8, 2025 10:12:25 AM

# How to record HTTP/HTTPS traffic with mitmproxy?

![Picture of Erdem KIRMIZI](https://explore.loadium.com/hs-fs/hubfs/bio.jpg?width=50&name=bio.jpg) [Erdem KIRMIZI](https://explore.loadium.com/loadium-blog/authors/erdem-kirmizi)

Share: [facebook-f icon](http://www.facebook.com/share.php?u=https://explore.loadium.com/loadium-blog/best-practices-for-api-security-testing-1-0-0-0-0-0-0-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-1756-edabd5f6) [linkedin-in icon](http://www.linkedin.com/shareArticle?mini=true&url=https://explore.loadium.com/loadium-blog/best-practices-for-api-security-testing-1-0-0-0-0-0-0-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-1756-edabd5f6) [Twitter icon](https://twitter.com/intent/tweet?url=https://explore.loadium.com/loadium-blog/best-practices-for-api-security-testing-1-0-0-0-0-0-0-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-1756-edabd5f6) [pinterest-p icon](http://pinterest.com/pin/create/link/?url=https://explore.loadium.com/loadium-blog/best-practices-for-api-security-testing-1-0-0-0-0-0-0-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-1756-edabd5f6) [envelope icon](mailto:?body=https://explore.loadium.com/loadium-blog/best-practices-for-api-security-testing-1-0-0-0-0-0-0-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-1756-edabd5f6)

![](https://cdn-images-1.medium.com/max/2560/1*YtZkNSsKb6l6z1hwtIa6Pw.jpeg)

Mobile performance engineering projects require record and playing while dealing with mobile apps. JMeter has a very good Proxy Recorder but there are other tools to help you overcome the challenges. One of these tools is; mitmproxy. You can browse its web site by [https://mitmproxy.org/](https://mitmproxy.org/)

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 dependency in a minute.

### How to Start Mitmproxy

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

![](https://cdn-images-1.medium.com/max/800/0*A89wFOjQrIFSeTY0.png)

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 devices proxy settings as described in [this blog post](https://loadium.com/blog/recording-scenario-mobile-applications/).
- Do any operation you want and get the recording

![](https://cdn-images-1.medium.com/max/800/0*oVVFNFEff9Y9QscT.png)

- 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.

![](https://cdn-images-1.medium.com/max/800/0*djxubkmsBYWksGBb.png)

### 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 (custom-headers, body data, path, etc..) will be saved into a file.

![](https://cdn-images-1.medium.com/max/800/0*aElFoIqhevcrZk1b.png)

#### Return to the Main Console

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

![](https://cdn-images-1.medium.com/max/800/0*abShHKFV1PAVQ28N.png)

#### Clear Recording

Just click “z” to clear 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!

## Related posts

[![](https://cdn-images-1.medium.com/max/800/1*joyHObJyFZbT-mb_MuWejw.jpeg)](https://explore.loadium.com/loadium-blog/http-live-streaming-performance-test)

[Stress Testing](https://explore.loadium.com/loadium-blog/tag/stress-testing), [Load Testing](https://explore.loadium.com/loadium-blog/tag/load-testing), [Examples](https://explore.loadium.com/loadium-blog/tag/examples)

## [HTTP Live Streaming Performance Test](https://explore.loadium.com/loadium-blog/http-live-streaming-performance-test)

![Picture of Erdem KIRMIZI](https://explore.loadium.com/hs-fs/hubfs/bio.jpg?width=50&name=bio.jpg) [Erdem KIRMIZI](https://explore.loadium.com/loadium-blog/authors/erdem-kirmizi) 

 Sep 8, 2025 11:08:38 AM

Why should you test HTTP Live Streaming Performance? HTTP Live Streaming protocol is designed by...

[Read more](https://explore.loadium.com/loadium-blog/http-live-streaming-performance-test)

[![](https://cdn-images-1.medium.com/max/2560/1*2p_HQIxqfKnI1aJJ6ok3ZA.png)](https://explore.loadium.com/loadium-blog/4-things-you-should-know-about-http-requests)

[Tools](https://explore.loadium.com/loadium-blog/tag/tools), [Examples](https://explore.loadium.com/loadium-blog/tag/examples)

## [4 Things You Should Know About HTTP Requests](https://explore.loadium.com/loadium-blog/4-things-you-should-know-about-http-requests)

![Picture of Erdem KIRMIZI](https://explore.loadium.com/hs-fs/hubfs/bio.jpg?width=50&name=bio.jpg) [Erdem KIRMIZI](https://explore.loadium.com/loadium-blog/authors/erdem-kirmizi) 

 Sep 8, 2025 10:32:14 AM

In order to perform a good performance test on the HTTP protocol, there is something that you...

[Read more](https://explore.loadium.com/loadium-blog/4-things-you-should-know-about-http-requests)

[![](https://cdn-images-1.medium.com/max/800/1*wR6gidLMtpRTNp_oO5pxwg.jpeg)](https://explore.loadium.com/loadium-blog/the-list-of-http-response-status-codes)

## [The List of HTTP Response Status Codes](https://explore.loadium.com/loadium-blog/the-list-of-http-response-status-codes)

![Picture of Erdem KIRMIZI](https://explore.loadium.com/hs-fs/hubfs/bio.jpg?width=50&name=bio.jpg) [Erdem KIRMIZI](https://explore.loadium.com/loadium-blog/authors/erdem-kirmizi) 

 Sep 8, 2025 11:12:45 AM

As a Performance Test Engineer, you will be dealing with lots of requests and their response codes...

[Read more](https://explore.loadium.com/loadium-blog/the-list-of-http-response-status-codes)

---

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Erdem KIRMIZI",
    "url" : "https://explore.loadium.com/loadium-blog/author/erdem-kirmizi"
  },
  "dateModified" : "2025-09-08T07:12:25.596Z",
  "datePublished" : "2025-09-08T07:12:25.000Z",
  "headline" : "How to record HTTP/HTTPS traffic with mitmproxy?",
  "image" : [ "https://cdn-images-1.medium.com/max/2560/1*YtZkNSsKb6l6z1hwtIa6Pw.jpeg" ],
  "mainEntityOfPage" : {
    "@id" : "https://explore.loadium.com/loadium-blog/best-practices-for-api-security-testing-1-0-0-0-0-0-0-0-0-0-1-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-0-1756-edabd5f6",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://explore.loadium.com/hubfs/Logo-1.png"
    },
    "name" : "Loadium"
  }
}
```