# local-ssl-proxy

> Simple SSL HTTP proxy using a self-signed certificate. Intended for local development only.

Latest version **2.0.5** (published 2023-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install local-ssl-proxy
pnpm add local-ssl-proxy
yarn add local-ssl-proxy
bun add local-ssl-proxy
```

Provides the commands `0`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.5 |
| Published | 2023-03-11 |
| First published | 2015-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 12.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 746 |
| Author | Cameron Hunter <hello@cameronhunter.co.uk> |
| Maintainers | cameronhunter |

## Links

- npm: https://www.npmjs.com/package/local-ssl-proxy
- Repository: http://github.com/cameronhunter/local-ssl-proxy
- npm.io page: https://npm.io/package/local-ssl-proxy

## Dependencies (3)

- [commander](https://npm.io/package/commander.md) ^10.0.0
- [http-proxy](https://npm.io/package/http-proxy.md) ^1.18.1
- [ansi-colors](https://npm.io/package/ansi-colors.md) ^4.1.3

## Recent versions

- 2.0.5 (latest) — 2023-03-11
- 2.0.4 — 2023-03-11
- 2.0.3 — 2023-03-11
- 2.0.2 — 2023-03-11
- 2.0.1 — 2023-03-11
- 2.0.0 — 2023-03-11
- 1.3.0 — 2016-02-03
- 1.2.3 — 2016-02-01
- 1.2.2 — 2015-11-12
- 1.2.1 — 2015-11-12
- 1.2.0 — 2015-11-12
- 1.1.3 — 2015-11-12
- 1.1.2 — 2015-11-12
- 1.1.1 — 2015-11-12
- 1.1.0 — 2015-07-02
- … 1 more at https://npm.io/package/local-ssl-proxy/versions

## README

# local-ssl-proxy

[![CI](https://github.com/cameronhunter/prettier-package-json/actions/workflows/ci.yml/badge.svg)](https://github.com/cameronhunter/prettier-package-json/actions/workflows/ci.yml) [![NPM Version](https://img.shields.io/npm/v/local-ssl-proxy.svg)](https://npmjs.org/package/local-ssl-proxy) [![License](https://img.shields.io/npm/l/local-ssl-proxy.svg)](https://github.com/cameronhunter/local-ssl-proxy/blob/master/LICENSE.md)

Simple SSL HTTP proxy using a self-signed certificate. Intended for local development only.

## Quick Start

The package supports immediate use via [`npx`](https://docs.npmjs.com/cli/v7/commands/npx) or you can install it
globally.

Use via `npx`:

```sh
npx local-ssl-proxy
```

Install globally:

```sh
npm install -g local-ssl-proxy
```

## Usage

To start a proxy from port `9001` to `9000` run:

```sh
local-ssl-proxy --source 9001 --target 9000
```

Start your web server on the target port (`9000` in the example) and navigate to `https://localhost:<source-port>` ([https://localhost:9001](https://localhost:9001) in the example). You'll get a warning because the certificate is self-signed, this is safe to ignore during development.

Using a dynamic DNS provider such as [noip](http://www.noip.com/personal/) or [DynDNS](http://dyn.com/dns/) or a static IP (if you have one) you can open a port in your firewall to allow external sites to call into your web server. This is great for developing applications using [OAuth](http://oauth.net/) without having to deploy externally.

## Advanced

You can also pass a configuration file, this helps share setups with team members. These can contain multiple proxies that `local-ssl-proxy` will open concurrently.

Example config:

```json
{
  "My proxy": {
    "source": 3001,
    "target": 3000
  },
  "Another proxy": {
    "source": 9999,
    "target": 9000
  }
}
```

And run the proxy with the configuration file:

```sh
local-ssl-proxy --config config.json
```

## Run SSL proxy with a self-signed trusted certificate

You can use it to host any domain, just change localhost to anything you like, wildcards are also supported.

1. Install [mkcert](https://github.com/FiloSottile/mkcert) (`choco install mkcert` / `brew install mkcert`)
1. Run `mkcert -install`
1. Run `mkcert localhost`
1. Run

```sh
local-ssl-proxy --key localhost-key.pem --cert localhost.pem --source 9001 --target 9000
```

1. You're all set! Just go to https://localhost:9001 and see your project working!

---
_Source: https://npm.io/package/local-ssl-proxy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
