UNPKG

2.85 kBMarkdownView Raw
1<p align="center">
2 <a href="https://github.com/geekdada/yasd">
3 <img width="300" src="https://raw.githubusercontent.com/geekdada/yasd/master/public/github-banner.png" alt="logo">
4 </a>
5</p>
6
7# yasd-helper
8
9[![NPM version][npm-image]][npm-url]
10[![TAONPM version][taonpm-image]][taonpm-url]
11![Nodejs][nodejs-version]
12[![David deps][david-image]][david-url]
13[![Known Vulnerabilities][snyk-image]][snyk-url]
14[![npm download][download-image]][download-url]
15[![install size](https://packagephobia.now.sh/badge?p=yasd-helper)](https://packagephobia.now.sh/result?p=yasd-helper)
16
17[npm-image]: https://img.shields.io/npm/v/yasd-helper.svg?style=flat-square
18[npm-url]: https://npmjs.org/package/yasd-helper
19[david-image]: https://img.shields.io/david/geekdada/yasd-helper.svg?style=flat-square
20[david-url]: https://david-dm.org/geekdada/yasd-helper
21[snyk-image]: https://snyk.io/test/npm/yasd-helper/badge.svg?style=flat-square
22[snyk-url]: https://snyk.io/test/npm/yasd-helper
23[download-image]: https://img.shields.io/npm/dm/yasd-helper.svg?style=flat-square
24[download-url]: https://npmjs.org/package/yasd-helper
25[taonpm-image]: https://npm.taobao.org/badge/v/yasd-helper.svg
26[taonpm-url]: https://npm.taobao.org/package/yasd-helper
27[nodejs-version]: https://img.shields.io/node/v/yasd-helper
28
29[中文](/README_zh-CN.md) | [English](/README.md)
30
31Surge only provides HTTP API to its users at the moment, crippling the possibility of using the PWA version of YASD. yasd-helper's goal is to expose HTTPS endpoints to Surge.
32
33## Installation
34
35Before installing yasd-helper, you need to make sure your environment already has Node.js installed (>=12.0.0).
36
37```bash
38$ npm install yasd-helper -g
39```
40
41## Usage
42
43yasd-helper uses the existing CA certificate generated by Surge to issue new certificates, so please make sure your Surge config has a valid MITM certificate, and your operating system has trusted the certificate. As long as the CA certificate is trusted by the operating system, you won't be prompted to trust any new certificates issued by it.
44
45![](assets/surge-mitm.png)
46
47```bash
48$ yasd-helper start --surge /path/to/surge.conf --host 192.168.1.2.nip.io [--port 8443]
49```
50
511. [nip.io](nip.io) gives you a domain based on the IP address. `192.168.1.2.nip.io` will be resolved to `192.168.1.2` where yasd-helper is going to be running at.
522. yasd-helper only exposes HTTPS endpoints at `https://192.168.1.2.nip.io`.
533. You can make it accessible outside your intranet, just to use the DDNS domain as `host`. yasd-helper will make sure only the responses from Surge API get passed.
544. You can use only one yasd-helper to access as many Surge instances as possible, as long as they are on the same intranet.
555. The default port is 8443, you can define another one by adding `--port <number>`
56
57## Daemonize
58
59### macOS LaunchAgent
60
61TBD
62
63### PM2
64
65TBD