Proxy server that records responses for UI testing (and other things)

Overview

Welcome to playback-proxy 👋

Version License: MIT

A proxy tool that records communication (requests, websockets) between client and server. This recording can later be used for tests as a mock backend. It works in 2 modes, RECORD and PLAYBACK, capturing and reproducing the server responses respectively.

Supported Features

  • Record multiple calls to the same endpoint. These will be reproduced in the same order during PLAYBACK as they were requested.
  • Record web socket events. These will be reproduced based on the last request and time before socket was received. This means that if the socket was received 2 seconds after a particular call in RECORD mode, during PLAYBACK it will be sent 2 seconds after that particular call is requested.
  • Specify a list of endpoints that are recorded only once. Same response will be used during PLAYBACK for every call. See SAVE_SINGLE parameter in the .env file
  • Specify a list of endpoints that are not printed to the log. See IGNORE_LOG parameter in the .env file

Unsupported (yet) Features

  • Saving responses in any other format (json, plaintext) than binary
  • Using https and wss protocols
  • Support for HAR files as records
  • Support for optional delay
  • Any other ideas people might have

Install

git clone https://github.com/kaphacius/playback-proxy.git

Setup

Install all dependencies with

pip3 install -r requirements.txt

🚀 Usage

There are 2 modes of running the tool: RECORD and PLAYBACK.

  • During RECORD, all communication between client and server is stored.
  • Duruing PLAYBACK, the socket uses previously stored responses when being requested.

Firstly, set up an .env file with mandatory and optional parameters. Copy the and rename template.env to a desired name. Mandatory parameters:

  • PROTOCOL - protocol used for communication (only http for now)
  • ENDPOINT - the address of the server to which the proxy will connect to
  • MODE - current mode. Can be changed later during when launching the proxy.
  • RECORDS_PATH - relative path to where all of the recordings will be stored. Must exists before running.
  • RECORDING - name of the current recording. This will be appended to RECORDS_PATH and a folder will be created to store saved data. Can be changed later when launching the proxy.

Make the starter script executable:

chmod +x proxy-starter.sh

Then, run the proxy in RECORD mode. Specify the name of the current recording RECORDING. This will create a folder (or use an existing one) where the responses will be saved. Set relative path to your specific .env file via PATH_TO_ENV_FILE. Specify address and port where the client will be connecting via PROXY_SERVER_ADDRESS and PROXY_PORT.

./proxy-starter.sh -m RECORD -r {RECORDING} -e {PATH_TO_ENV_FILE} -a {PROXY_SERVER_ADDRESS} -p {PROXY_PORT}

Perform necessary interactions with the backend and stop the proxy by pressing Ctrl+C.

Finally, run the proxy in PLAYBACK mode. Interact with the server the same way as during recording - receive the same responses.

./proxy-starter.sh -m PLAYBACK -r {RECORDING} -e {PATH_TO_ENV_FILE} -a {PROXY_SERVER_ADDRESS} -p {PROXY_PORT}

Author

👤 Yurii Zadoianchuk

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2021 Yurii Zadoianchuk.

This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

You might also like...
A little proxy tool based on Tencent Cloud Function Service.
A little proxy tool based on Tencent Cloud Function Service.

SCFProxy 一个基于腾讯云函数服务的免费代理池。 安装 python3 -m venv .venv source .venv/bin/activate pip3 install -r requirements.txt 项目配置 函数配置 开通腾讯云函数服务 在 函数服务 新建 中使用自定义

a script to bulk check usernames on multiple site. includes proxy & threading support.

linked-bulk-checker bulk checks username availability on multiple sites info people have been selling these so i just made one to release dm my discor

[Multithreading] [Proxy - auto & infile]

Discord-Token-Generator-AutoCheck [Multithreading] [Proxy - auto & infile] How to install? pip install -r requirements.txt run generator.py with pytho

Discord Webhook Proxy for Roblox payloads.
Discord Webhook Proxy for Roblox payloads.

RoProxy A Discord webhook proxy passthrough for roblox. Setup Your port and endpoint are in the config.json, make sure both app.py and config.json are

The EscapePod Python SDK for Cyb3rVector's EscapePod Extension Proxy

EscapePod Extension SDK for Python by cyb3rdog This is the EscapePod Python SDK for Cyb3rVector's EscapePod Extension Proxy. With this SDK, you can: m

Automate coin farming for dankmemer. Unlimited accounts at once. Uses a proxy

dankmemer-farm Simple script to farm Dankmemer coins with multiple accounts at once. Requires: Proxies, Discord Tokens Disclaimer I don't take respons

 Pancakeswap Sniper BOT - TORNADO CASH Proxy (MAC WINDOWS ANDROID LINUX) A fully decentralized protocol for private transactions
Pancakeswap Sniper BOT - TORNADO CASH Proxy (MAC WINDOWS ANDROID LINUX) A fully decentralized protocol for private transactions

TORNADO CASH Proxy Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX) ⭐️ A fully decentralized protocol for private transactions ⭐️ AUTO DOWNL

TORNADO CASH Proxy Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX)
TORNADO CASH Proxy Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX)

TORNADO CASH Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX) ⭐️ A ful

Simple Webhook Spammer with Optional Proxy Support
Simple Webhook Spammer with Optional Proxy Support

😎 �Simple Webhook Spammer with Optional Proxy Support:- [+] git clone https://g

Comments
  • Using sqlite as data store

    Using sqlite as data store

    This is a suggestion. Using sqlite as data store instead of pickling to binary file might be much easier to handle and provide interoperability with other possible tools.

    opened by altunyurt 1
Releases(0.1.0)
Owner
Yurii
Yurii
Unarchive Bot for Telegram

Telegram UnArchiver Bot UnArchiveBot: 🇬🇧 Bot that allows you to extract supported archive formats in telegram. 🇹🇷 Desteklenen arşiv biçimleri tele

Hüzünlü Artemis [HuzunluArtemis] 25 May 07, 2022
A discord bot thet lets you play Space invaders.

space_Invaders A discord bot thet lets you play Space invaders. It is my first discord bot... so please give any suggestions to improve it :] Commands

2 Dec 30, 2021
cipher bot telegram

cipher-bot-telegram cipher bot telegram Telegram bot that encode/decode your messages To work correctly, you must install the latest version of python

anonim 1 Oct 10, 2021
A corona statistics and information telegram bot.

A corona statistics and information telegram bot.

Fayas Noushad 15 Oct 21, 2022
Telegram Reporter

[Telegram Reporter v.3 ] 🇮🇷 AliCybeRR 🇮🇷 [ AliCybeRR.Reporter feature ] Login Your Telegram account 👽 support Termux ❕ No Limits ⚡ Secure 🔐 Free

AliCybeRR 1 Jun 08, 2022
Análise de dados abertos do programa Taxigov.

Análise de dados do Taxigov Este repositório contém os cadernos Jupyter usados no projeto de análise de dados do Taxigov. Conjunto de dados O conjunto

Augusto Herrmann 1 Jan 10, 2022
An script where it logs in your instagram account and follows people and likes their posts

InstaFollower An script where it logs in your instagram account and follows people and likes their posts (uses the tags to fetch people) Requirements:

Bless 3 Nov 29, 2022
A fork of discord.py meant to replace it

Texus A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using async and

Texus 1 Nov 18, 2021
Python script to download WAX transactions

WAXtax Python script to download WAX transactions WAXtax uses the CoinGecko API and the WAX Blockchain History API to download csvs for each account y

SixPM Software 11 Oct 09, 2022
Python Library for Secp256k1 Bitcoin curve to do fast ECC calculation

secp256k1 Python Library for Secp256k1 Bitcoin curve to do fast ECC calculation Example Usage import secp256k1 as ice print('[C]',privatekey_to_addres

iceland 49 Jan 01, 2023
WhatsApp API Python ChatBot

WhatsApp Api Python - Esta documentação tem como objetivo exemplificar o uso do Moorse Whatsapp API na linguagem Python.

Douglas Alves 2 Jan 06, 2022
AWS Lambda - Parsing Cloudwatch Data and sending the response via email.

AWS Lambda - Parsing Cloudwatch Data and sending the response via email. Author: Evan Erickson Language: Python Backend: AWS / Serverless / AWS Lambda

Evan Scott Erickson 1 Nov 14, 2021
HTTP Calls to Amazon Web Services Rest API for IoT Core Shadow Actions 💻🌐💡

aws-iot-shadow-rest-api HTTP Calls to Amazon Web Services Rest API for IoT Core Shadow Actions 💻 🌐 💡 This simple script implements the following aw

AIIIXIII 3 Jun 06, 2022
An Open-Source Discord bot created to provide basic functionality which should be in every discord guild. We use this same bot with additional configurations for our guilds.

A Discord bot completely written to be taken from the source and built according to your own custom needs. This bot supports some core features and is

Tesseract Coding 14 Jan 11, 2022
A Discord Self-Bot in Python

👨‍💻 Discord Self Bot 👨‍💻 A Discord Self-Bot in Python by natrix Installation Run: selfbot.bat Python: version : 3.8 Modules

natrix_dev 3 Oct 02, 2022
Telegram bot for our internal organizers tasks

Welcome to ppm-telegram-bot 👋 Telegram Bot Platform integration for bot commands processing. We use it for our internal @piterpy-meetup needs, basica

PiterPy Meetup 10 Jul 28, 2022
Most Simple & Powefull web3 Trade Bot (WINDOWS LINUX) Suport BSC ETH

Most Simple & Powefull Trade Bot (WINDOWS LINUX) What Are Some Pros And Cons Of Owning A Sniper Bot? While having a sniper bot is typically an advanta

GUI BOT 6 Jan 30, 2022
A head unit UI designed to replace the RTx/SMEG/RNEG/NG4/RCC/NAC

HeadUnit UI (Come discuss about it on our Discord!) Intro This is the UI part of a headunit project from OpenLeo, based on python and kivy, it looks l

OpenLeo 6 Nov 23, 2022
The Dolby.io Developer Days Getting Started with Media APIs Workshop repo.

Dolby.io Developer Days Media APIs Getting Started Application About this Workshop and Application This example is designed to get participants workin

Dolby.io Samples 2 Nov 03, 2022
Multi-purpose bot made with discord.py

PizzaHat Discord Bot A multi-purpose bot for your server! ℹ️ • Info PizzaHat is a multi-purpose bot, made to satisfy your needs, as well as your serve

DTS 28 Dec 16, 2022