New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

harproxyserver

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

harproxyserver

A simple proxy server that records and plays back HTTP requests and responses in HAR format.

  • 0.0.12
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-88.57%
Maintainers
1
Weekly downloads
 
Created
Source

npm version

HAR Proxy Server

HAR Proxy Server is a simple proxy server that records and plays back HTTP requests and responses in HAR format. It can be used as a standalone executable or integrated into other projects as an npm package.

Features

  • Record HTTP requests and responses to a HAR file.
  • Playback recorded requests and responses from a HAR file
  • Serve requests over HTTP or HTTPS.
  • Configurable playback endpoint prefix
  • Middleware support for Express.js.
  • Command-line interface for easy configuration

Installation

To install the server as a global command-line utility:

npm install --location=global harproxyserver

Usage

API

harproxyserver / Exports

Standalone Executable

Run the server using the harServer command:

Start the server in play mode (default)

harproxyserver -p 3000 -f recorded.har

Start the server in record mode

harproxyserver -p 3000 -t http://example.com -f recorded.har -m record

Start the server with HTTPS

harproxyserver -p 3000 -f recorded.har --tls --key-file server.key --cert-file serv

In Your Project

Import the server and utility functions in your project:

import { findHarEntry, recordedHarMiddleware } from 'harproxyserver';

Command-Line Options

The available options for this tool are:

  • --port, -p : The port the server will listen on (default: 3000).
  • --target-url, -t : The target URL to proxy when in 'record' mode.
  • --har-file, -f : The file path to save the HAR file (default: recording-[date and time].har).
  • --prefix : The prefix for the HAR playback endpoint (default: '').
  • --mode, -m : The mode to run the server in (default: 'play'). Choices are 'play' or 'record'.
  • --tls: Run the server in secure mode (HTTPS) (default: false).
  • --key-file : Path to the TLS private key file (required when using --tls).
  • --cert-file : Path to the TLS certificate file (required when using --tls).

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Keywords

FAQs

Package last updated on 20 Apr 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc