# h2server

> An out-of-the-box web server for serving up local files, support https & http2

Latest version **0.3.0** (published 2020-09-28) · MIT license · 0 weekly downloads

## Install

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

Provides the command `h2server`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2020-09-28 |
| First published | 2019-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.12 |
| Dependencies | 1 |
| Unpacked size | 2.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | xuld |
| Maintainers | xuld, teal |

## Links

- npm: https://www.npmjs.com/package/h2server
- Repository: https://github.com/Teal/H2Server
- Homepage: https://github.com/Teal/H2Server#readme
- Issues: https://github.com/Teal/H2Server/issues
- npm.io page: https://npm.io/package/h2server

## Dependencies (1)

- [tutils](https://npm.io/package/tutils.md) ^2.0.0

## Recent versions

- 0.3.0 (latest) — 2020-09-28
- 0.2.0 — 2020-09-28
- 0.1.0 — 2019-12-07
- 0.0.7 — 2019-12-06
- 0.0.6 — 2019-12-06
- 0.0.4 — 2019-09-03
- 0.0.3 — 2019-09-03
- 0.0.2 — 2019-06-26
- 0.0.1 — 2019-05-29

## README

# H2Server
An out-of-the-box web server for serving up local files, support https & http2.

![overview][overview]

## Installation
First, install [Node.js](http://nodejs.org/). Then:

```bash
npm install h2server -g
```

## Usage
Run `h2server` on the command line to fire up an HTTP/1.1 server on 0.0.0.0:
```bash
h2server
```

H2Server will serve out of your current working directory.

You can pass in arguments to change the port and host:
```bash
h2server 8080
```

In order to support HTTP/2, you should specify an https url:
```bash
h2server https://0.0.0.0:8080
```
By default, H2server will use an untrusted self-signed certificate. You should skip the certificate warning in browser. Pass `--cert` and `--key` to specify your certificate.

In additional, you can pass `-o`/`--open` to open homepage in browser when started:
```bash
h2server -o
```

## Options
- `--open`, `-o`: Open browser after starting the server
- `--help`, `-h`, `-?`: Print helps
- `--cors`: Enable CORS via the Access-Control-Allow-Origin header
- `--proxy`, `-p`: Proxies all requests which can't be resolved locally to the given url. e.g.: -p http://someurl.com
- `--cert`: Path to ssl cert file
- `--key `: Path to ssl key file
- `--version`, `-v`: Print version

[overview]: https://github.com/Teal/H2Server/blob/master/screenshot.png

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