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
Proxy-Bot - Python proxy bot for telegram

Proxy-Bot ?? Proxy bot between the main chat and a newcomer, allows all particip

Anton Shumakov 3 Apr 1, 2022
A Python Library to interface with LinkedIn API, OAuth and JSON responses

#Overview Here's another library based on the LinkedIn API, OAuth and JSON responses. Hope this documentation explains everything you need to get star

Mike Helmick 69 Dec 11, 2022
A Python Library to interface with Flickr REST API, OAuth & JSON Responses

Python-Flickr Python-Flickr is A Python library to interface with Flickr REST API & OAuth Features Photo Uploading Retrieve user information Common Fl

Mike Helmick 40 Sep 25, 2021
This repository provides a set functions to extract paragraphs from AWS Textract responses.

extract-paragraphs-with-aws-textract Since AWS Textract (the AWS OCR service) does not have a native function to extract paragraphs, this repository p

Juan Anzola 3 Jan 26, 2022
The records of 42 million users from a third-party version of the popular Telegram messaging app have just been Iranian accounts leaked

TelegramDatabase About The records of 42 million users from a third-party version of the popular Telegram messaging app have just been Iranian account

Hamed Mohammadvand 10 Jan 14, 2022
Source Code for our bot that manages time and other functions of the server <3

Komi San wants you to study This repo contains the source code for our bot that manages time and other functions of the server <3 Features Your study

Komi San wants you to study 8 Nov 8, 2021
a harbinger of events or things.

Herald: Intrusion Detection System using IR and ML Herald - noun; a harbinger of events or things. Overview Herald is an intrusion detection system us

Muhammad Muzzammil 4 Jun 7, 2021
An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

JOBIN 0 Dec 1, 2021
An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

URL Uploader Bot An Open Source ALL-In-One Telegram RoBot, that can do lot of things. My Features Installation The Easy Way You can also tap the Deplo

NT BOTS 1 Oct 23, 2021
The fastest nuker on discord, Proxy support and more

About okuru nuker is a nuker for discord written in python, It uses methods such as threading and requests to ban faster and perform at higher speeds.

null 63 Dec 31, 2022