npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fake-corp-proxy

v1.1.0

Published

Fake proxy to test proxying in applications.

Downloads

2

Readme

fake-corp-proxy npm version

A Node.js module and command-line utility to start a fake HTTP(S) Forward-Proxy server with Basic or NTLM fake authentication.

Installation

To use as a command-line utility:

npm install -g fake-corp-proxy

To use as a node.js module:

npm install fake-corp-proxy

CLI HTTP usage

Simple usage:

fake-corp-proxy --port 8080 --ntlm

Available options:

Options:
  --version          Show version number                               [boolean]
  --port, -p         Use this port when starting proxy  [number] [default: 8080]
  --basic, -b        Enable Basic Authentication      [boolean] [default: false]
  --ntlm, -n         Enable NTLM Authentication       [boolean] [default: false]
  --https, -s        Enable HTTPS server              [boolean] [default: false]
  -h, --help         Show help                                         [boolean]

CLI HTTPS usage

To make fake-corp-proxy to handle HTTPS protocol, you need to generate a CA certificate:

fake-corp-proxy-ca root my-ca-name

Then, you have to trust the generated certificate on your OS (More infos).

Once your CA certificate is trusted you can tunnel HTTPS requests to your proxy. You can also run the proxy in HTTPS mode.

fake-corp-proxy --https

If you forget where is stored you CA certificate, you can run:

fake-corp-proxy-ca root-path

Module usage

Simple usage:

const fakeProxy = require("fake-corp-proxy");

// Start server
const server = fakeProxy.start({
    port: 8080,
    ntlm: true
});

// When finished
server.close();

*Note: The same options as CLI are available"

Proxy Auto-Configuration (PAC Script)

This Proxy supports PAC Script generation:

curl http://localhost:8080/pac

Simulate Authentication errors

This module does not really authenticate users. To simulate an unauthorized user, just use a username starting with unknwown. (eg: unkwnown, unkwnown-user, unkwnown-test)

curl --proxy-insecure -x \"https://unknown:password@localhost:8081\" https://www.google.com/

Exemples

Forward-Proxy in HTTP only:

fake-corp-proxy

Forward-Proxy with HTTP and HTTPS modes enabled:

fake-corp-proxy --https

Forward-Proxy with HTTP and HTTPS and Basic authentication:

fake-corp-proxy --https --basic

Forward-Proxy with HTTP and HTTPS and NTLM authentication:

fake-corp-proxy --https --ntlm

Forward-Proxy with HTTP and HTTPS and NTLM authentication and verbose logging (details of authentication):

fake-corp-proxy --https --ntlm --verbose

Trust CA certificate

On Windows:

  1. Double-click on the certificate file
  2. Click on the Install Certificate button
  3. On opened window, select Place all certificates in the following store
  4. Click Browse then select Trusted Root Certification Authorities and click OK

On OSX:

  1. Double-click on the certificate file
  2. Select login or system in the select box and click Add
  3. Open Keychain and find the newly imported certificate
  4. Double-click on the certificate
  5. Select Always Trust in the When using this certificate select box

License

View license information for the software contained in this image.

Contributing

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.