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

reverse_proxy_pathmapper

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reverse_proxy_pathmapper

Reverse proxy URL path mapper using http-proxy.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

reverse_proxy_pathmapper

Reverse proxy URL path mapper using http-proxy.

Usage

import {ReverseProxyPathMapper} from "reverse_proxy_path_mapper";
new ReverseProxyPathMapper({}, pathMapper).serve(9000);

Example PathMapper object

  • Key of path mapper object takes the string type which can include the regex string. Key must start with leading /
  • Value of path mapper object takes the string or object
    • If string then it must be a URL to the destination server.
    • If object then it should have two property URL (Destination Server URL) and rewriteURL (Either to append Destination URL with the incoming url or not);
const pathMapper = {
  '/8080/?(.*)': 'http://localhost:8080', // value must not end with trailing slash
  '/8081/?(.*)': {
    URL: 'http://localhost:8081',
    rewriteURL: false
    // since rewriteURL is false proxy will append '/8081/<regex url>' to http://localhost:8081 -> Final URL: 'http://localhost:8081/8081/<regex url>'
  },
  '/8081/static': {
    URL: 'http://localhost:8081',
    rewriteURL: true
    // since rewriteURL is true proxy will not append '/8081/static' to http://localhost:8081 -> Final URL: http://localhost:8081
  }
}

Keywords

FAQs

Package last updated on 17 May 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