Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ivangabriele/publichost

Make your localhost apps public by tunneling subdomains to them.
https://github.com/ivangabriele/publichost

cli local local-dev localhost localtunnel ngrok sdk server tunnel tunnel-client tunnel-server

Last synced: 17 days ago
JSON representation

Make your localhost apps public by tunneling subdomains to them.

Awesome Lists containing this project

README

        


FirePT Logo


PublicHost


Tunneling subdomains to your localhost applications.




NPM Version


AGPL-3.0 license


CI Check Workflow


CI E2E Workflow

---

- [Why PublicHost?](#why-publichost)
- [Features](#features)
- [How it works](#how-it-works)
- [Installation](#installation)
- [CLI](#cli)
- [Usage](#usage)
- [Node.js SDK](#nodejs-sdk)
- [Koa Example](#koa-example)
- [Express Example](#express-example)

---

## Why PublicHost?

Because [ngrok](https://ngrok.com) but open-source and free.

## Features

- [x] PublicHost Server
- [x] Basic API Key Authentication
- [x] PublicHost Client
- [x] CLI commands
- [x] Node.js SDK

## How it works

**To be updated.**

## Installation

### CLI

```sh
npm install -g publichost
```

### Usage

```sh
ph --help
```

### Node.js SDK

```sh
npm install -E publichost
```

#### Koa Example

```ts
import Koa from 'koa'

const { PORT, PUBLICHOST_API_KEY, PUBLICHOST_HOST, PUBLICHOST_SUBDOMAIN } = process.env

const app = new Koa()

app.listen(PORT, () => {
console.info('[My Amazing Localhost App]', `Server listening on port ${PORT}.`)

startPublicHost(PUBLICHOST_HOST, PUBLICHOST_SUBDOMAIN, PUBLICHOST_API_KEY, {
localhostAppPort: PORT,
})
})
```

### Express Example

```ts
import express from 'express'

const { PORT, PUBLICHOST_API_KEY, PUBLICHOST_HOST, PUBLICHOST_SUBDOMAIN } = process.env

const app = express()

app.listen(PORT, () => {
console.info('[My Amazing Localhost App]', `Server listening on port ${PORT}.`)

startPublicHost(PUBLICHOST_HOST, PUBLICHOST_SUBDOMAIN, PUBLICHOST_API_KEY, {
localhostAppPort: PORT,
})
})
```