# pwalauncher

> The PWA launcher for react-declarative

Latest version **1.0.46** (published 2024-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install pwalauncher
pnpm add pwalauncher
yarn add pwalauncher
bun add pwalauncher
```

Provides the command `pwalauncher`.

## 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 | 1.0.46 |
| Published | 2024-07-07 |
| First published | 2024-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 987.8 KB |
| Known vulnerabilities | 0 (+12 in 5 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Petr Tripolsky |
| Maintainers | tripolskypetr |
| Keywords | react-declarative, pwa, reverse-proxy, https, http, port-forwarding, path-proxy, proxy, cors, mixed-content, same-origin, websocket, osint, honeypot |

## Links

- npm: https://www.npmjs.com/package/pwalauncher
- Repository: https://github.com/tripolskypetr/pwalauncher
- Issues: https://github.com/tripolskypetr/pwalauncher/issues
- Funding: http://paypal.me/tripolskypetr
- npm.io page: https://npm.io/package/pwalauncher

## Dependencies (15)

- [pino](https://npm.io/package/pino.md) 8.20.0
- [uuid](https://npm.io/package/uuid.md) 9.0.1
- [dotenv](https://npm.io/package/dotenv.md) 16.4.5
- [sockjs](https://npm.io/package/sockjs.md) 0.3.24
- [express](https://npm.io/package/express.md) 4.19.2
- [nocache](https://npm.io/package/nocache.md) 4.0.0
- [body-parser](https://npm.io/package/body-parser.md) 1.20.2
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) 8.5.1
- [pino-express](https://npm.io/package/pino-express.md) 1.1.1
- [cookie-parser](https://npm.io/package/cookie-parser.md) 1.4.6
- [serialize-error](https://npm.io/package/serialize-error.md) 11.0.3
- [http2-express-bridge](https://npm.io/package/http2-express-bridge.md) 1.0.7
- [rotating-file-stream](https://npm.io/package/rotating-file-stream.md) 3.2.1
- [http-proxy-middleware](https://npm.io/package/http-proxy-middleware.md) 2.0.6
- [http2-express-autopush](https://npm.io/package/http2-express-autopush.md) 1.0.5

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.46 (latest) — 2024-07-07
- 1.0.45 — 2024-06-14
- 1.0.44 — 2024-06-14
- 1.0.43 — 2024-06-14
- 1.0.42 — 2024-06-14
- 1.0.41 — 2024-06-13
- 1.0.40 — 2024-06-13
- 1.0.39 — 2024-06-13
- 1.0.38 — 2024-06-12
- 1.0.37 — 2024-06-12
- 1.0.36 — 2024-06-12
- 1.0.35 — 2024-06-12
- 1.0.34 — 2024-06-12
- 1.0.33 — 2024-06-12
- 1.0.32 — 2024-06-12
- … 33 more at https://npm.io/package/pwalauncher/versions

## README

# pwalauncher

> The microservice bootstrap for PWA with [serverless functions](https://appwrite.io/docs/products/functions)

## Usage

```bash
npm install -g pwalauncher
pwalauncher # Will share `wwwroot` subfolder with static assets and redirect to `index.html` if 404
```

## Benefits

1. **Free SSL Certificate obuse**

Create a [ZeroSSL](https://zerossl.com/) 90-days sertificate for single domain and multiply it to several websites shared on different ports

2. **Port forward over SSL**

Forwarding `https://example.com/8081` to `http://localhost:8081`. Both websoket and http forwarding are supported

3. **JWT Validation for each forwarded port**

While forwarding to `http://localhost:8081` the `pwalauncher` can intercept `Authorization: Bearer <token>` header and validate the token. The UI can sign a token every 10 seconds to avoid DDOS

4. **CRA-like API proxy**

Request to `https://example.com/v1` can be forwarded to `https://cloud.appwrite.io/v1`

4. **Cors-everywhere like file download proxy**

Fetch from `https://example.com/cors/http://filedownload.com/demo.mp3` will download `http://filedownload.com/demo.mp3` ignoring mixed content and cord origin policy

5. **Mutal SSL auth on a server side**

A self-signed SSL certificate installed localy can be used to restrict access to application authorisation with second layer of authentification

## Ecosystem

This tool is extreamly powerfull with [PM2](https://pm2.keymetrics.io/). The `pm2` should be used for *instantiation* while `pwalauncher` used as *easy-config reverse-proxy*

```bash
pm2 start ecosystem.config.js
pm2 list
pm2 save
pm2 monit
pm2 stop service
pm2 kill
```

The [tmux](https://github.com/tmux/tmux) also can be used to start microservices in `debug` mode with direct stdin/stdout pipe

```bash
tmux kill-session
tmux
tmux attach
Ctrl + B + D
Ctrl + B + C
Ctrl + B + P
Ctrl + B + N
```

The `pwalaunch` used single argument if you want to use different name of config.

```bash
pwalaunch launcher.config.json
```

## Configutation

```javascript
const fs = require('fs');

module.exports = {
    ports: [
        8081,
        8082,
        8083,
        8084,
        8085,
        8086,
        8087,
        8088,
        8089,
        8090,
    ],
    proxy: [
        {
            path: 'v1',
            link: 'http://127.0.0.1:8080/v1'
        }
    ],
    ssl: {
        key: fs.readFileSync('./ssl/private.key', 'utf8'),
        cert: fs.readFileSync('./ssl/certificate.crt', 'utf8'),
    },
    sslPort: 444,
    sslVerify: true,
    jwtSecret: "TEST",
    cookieSecret: true, // { key: "test", value: "1", }
    cookieSecretAllowed: ['/', '/index.html', '/favicon.ico'],
    ipBlacklist: ["95.173.136.72"],
    port: 80,
    redirectHttps: false,
    wwwroot: "build"
};
```

## Self-signed SSL Setup

If you getting trouble while trying to setup self-signed ssl, check the [3rdparty folder](./3rdparty/). The `SSLCertificateMaker.exe` will help you create root certificate (CA) for client devices and self-signed children (CERT) for the server. The `CertTrustManager.exe` will help you create a one-button setup file for root certificate (CA), to create that file right click on CertTrustManager window. 

![screenshot](./docs/screenshot.png)

P.S. If you choose wrong certificate in modal run `chrome://restart` to choose It again or use Edge

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