mitmproxy

Interactive TLS-capable intercepting HTTP proxy

Declared in: projects/mitmproxy/default.nix

Try the program in a shell

  1. Install Nix
    Bash
    $ apt install --yes curl git jq nix
    Bash
    $ apt install --yes curl git jq nix
    Bash
    $ pacman --sync --refresh --noconfirm curl git jq nix
  2. Download a configuration file
    # default.nix
    {
      ngipkgs ? import (fetchTarball "https://github.com/ngi-nix/ngipkgs/tarball/main") { },
    }:
    ngipkgs.demo-shell (
      { ... }:
      {
        programs.mitmproxy = {
          enable = true;
          swagger.enable = true;
        };
      }
    
    )
    
  3. Enable binary substituters
    Bash
    $ export NIX_CONFIG='substituters = https://cache.nixos.org/ https://ngi.cachix.org/
    trusted-public-keys = cache.nixos.org-1:6nchdd59x431o0gwypbmraurkbj16zpmqfgspcdshjy= ngi.cachix.org-1:n+cal72roc3qqulxihpv+tw5t42whxmmhpragkrsrow='
  4. Build and run the shell
    Bash
    $ nix-build ./default.nix && ./result
    Bash
    $ nix-build ./default.nix && ./result
    Bash
    $ rev=$(nix-instantiate --eval --attr sources.nixpkgs.rev https://github.com/ngi-nix/ngipkgs/archive/master.tar.gz | jq --raw-output)
    $ nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/$rev.tar.gz --packages nix --run "nix-build ./default.nix && ./result"
    Bash
    $ nix-build ./default.nix && ./result
  5. Missing Contribute usage instructions.

Options

programs.mitmproxy
programs.mitmproxy.enable

Whether to enable mitmproxy.

Type:
boolean
Default:
false
Declared in:
projects/mitmproxy/module.nix
programs.mitmproxy.package

The mitmproxy package to use.

Type:
package
Default:
pkgs.mitmproxy
Declared in:
projects/mitmproxy/module.nix
programs.mitmproxy.swagger.enable

Whether to enable mitmproxy2swagger.

Type:
boolean
Default:
false
Declared in:
projects/mitmproxy/module.nix
programs.mitmproxy.swagger.package

The mitmproxy2swagger package to use.

Type:
package
Default:
pkgs.mitmproxy2swagger
Declared in:
projects/mitmproxy/module.nix

Examples

basic
{ ... }:
{
  programs.mitmproxy = {
    enable = true;
    swagger.enable = true;
  };
}

Declared in: projects/mitmproxy/demo.nix

This project is funded by NLnet through these subgrants:

Entrust
mitmproxy