hidden-service
import { start } from "hidden-service"
const { hostname } = await start({
port: 80, // Same as { 80: 80 } or { 80: "127.0.0.1:80" }
})
console.log(hostname) // n72...uqd.onion
const { hostname, tor, hiddenServiceDirectory } = await start(options)
options
:
{
port: 80, // Default port, maps to 127.0.0.1:80
privateKey: undefined // Optional Ed25519 private key
}
tor
spawnedChildProcess
.hostname
onion hostname (n72...uqd.onion).hiddenServiceDirectory
directory containing (hs_ed25519_secret_key
,hs_ed25519_public_key
,hostname
) (created usingfs.mkdtemp
).
Resolves once Tor is fully bootstrapped.
privateKey
, 32 byte Uint8Array
with a random Ed25519 private key (re-exported from noble-ed25519).
secretKey
, 96 byte Uint8Array
expanded and tagged privateKey
.
publicKey
, 64 byte Uint8Array
tagged publicKey
.
hostname
, version 3 onion address.