Something went wrong. Try again.
auth proxy
Something went wrong. Try again.
123456789101112131415161718192021222324#!/usr/bin/env nodeimport { loadConfig } from './config.js'import { startServer } from './server.js'
const configPath = process.argv[2]if (!configPath) { console.error('usage: keyhole <config.json>') process.exit(2)}
try { const config = await loadConfig(configPath) const server = await startServer(config) const address = server.address() if (!address || typeof address === 'string') throw new Error('server address unavailable') console.error(`keyhole listening on http://${address.address}:${address.port}`) const shutdown = () => server.close(() => process.exit(0)) process.on('SIGINT', shutdown) process.on('SIGTERM', shutdown)} catch { console.error('keyhole failed to start') process.exit(1)}