Go module that connects a machine to Hostinger CDN tunnels. It powers
hostinger preview in the Hostinger CLI,
which shares a local dev server at a temporary public HTTPS URL.
The connector opens outbound TLS sessions to nearby CDN PoPs (port 7844), and the edge sends visitor requests back over them. The machine needs no public IP and no open inbound port.
Status: v0.x. Until v1, a minor version can break the Go API.
Use the Hostinger CLI:
brew install hostinger/tap/hostinger
hostinger preview 5173Report problems with the hostinger command in
hostinger/api-cli, and bugs
in the connector here.
go get github.com/hostinger/hcdn-connector@latestconnector.RunQuick runs a whole quick tunnel in one call and prints nothing:
expired, err := connector.RunQuick(ctx, connector.QuickOptions{
URL: "http://localhost:5173",
HostHeader: "localhost",
OnReady: func(q connector.QuickTunnel) { fmt.Println(q.URL) },
})err is nil when ctx ends or the tunnel expires (expired is true).
A named tunnel with its own client certificate uses connector.New; see
examples/embed. The API reference is on
pkg.go.dev.
The library opens no listener, installs no signal handler and never calls
os.Exit. It builds with CGO_ENABLED=0 for Linux, macOS and Windows on
amd64 and arm64. It never shares sensitive ports on this machine (SSH,
databases, debuggers and similar; see pkg/localguard).
pkg/connector,pkg/config,pkg/credsandpkg/localguardare the public API and follow semver fromv0.2.0. While the module isv0, a breaking change bumps the minor version. Type aliases ofinternal/...types inpkg/connectorare public API too.internal/...has no compatibility promise.- Error text can hold text from the edge as received. Escape it before you print it to a terminal.
connector.Metricsexposes Prometheus types; a smaller interface may replace it in a minor version.- The wire protocol follows
docs/protocol.md, not the module version.
cmd/hcdn-connector wraps the library for development and testing. It is
not a supported product. Its reference (install, config, commands, metrics)
is in docs/standalone.md.
make lint testSee CONTRIBUTING.md. Report security issues as
described in SECURITY.md.