Socket
Book a DemoInstallSign in
Socket

http-playback-proxy

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-playback-proxy

## Install

latest
npmnpm
Version
2.1.0
Version published
Maintainers
1
Created
Source

HTTP proxy that records resources as editable and playback them

Install

yarn add http-playback-proxy

Example

import { PlaybackProxy } from 'http-playback-proxy'

async function main() {
  const recorder = new PlaybackProxy({
    saveDir: '/path/to/resources',
    host: 'localhost',
    port: 8000,
    mode: 'online',
  })

  await recorder.start()

  // Set "http://localhsot:8000" as HTTP proxy and send request

  await recorder.stop()

  // See /path/to/resources and edit some resources

  const player = new PlaybackProxy({
    saveDir: '/path/to/resources',
    host: 'localhost',
    port: 8000,
    mode: 'online',
  })

  await player.start()

  // Set "http://localhsot:8000" as HTTP proxy and send request
  // Edited resource will changed

  await player.stop()
}

main()

FAQs

Package last updated on 03 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts