Because ngrok but open-source and free.
- PublicHost Server
- Basic API Key Authentication
- PublicHost Client
- CLI commands
- Node.js SDK
To be updated.
npm install -g publichost
ph --help
npm install -E publichost
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,
})
})
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,
})
})