Skip to content

Instantly share code, notes, and snippets.

'''
Generating Python script that replays HTTP requests captured by mitmproxy/mitmdump.
Usage:
$ mitmdump -s /tmp/replay_script_generator.py 2>&1 >/dev/null
'''
import pprint
import sys
pp = pprint.PrettyPrinter(indent=4)
@huyphan
huyphan / awsv4sign.js
Created January 5, 2023 10:43
Helper library to allow Grafana K6 to sign SigV4 requests to API Gateway
/** Modified version of https://github.com/s0rc3r3r01/awsv4sign/blob/master/awsv4sign.js to make it work with API Gateway */
/* eslint-__ENV node */
/* eslint no-use-before-define: [0, "nofunc"] */
"use strict";
var crypto = require("k6/crypto");
//v4Sign takes a standard http request object and returns the request signed with AWS V4 Signature
function v4Sign(req, awsCredentials, options) {