README 未给出服务端启动命令,需查阅 Wiki 的 Getting Started;TCP 代理必须经 piko forward 或 Go SDK 连接,不能直连服务端;HTTP 用 Host 路由时需配置通配域名,否则改用 x-piko-endpoint 头

piko
andydunstallMIT活跃维护用 Go 写的开源 Ngrok 替代品,专注承载生产流量,部署简单,特别适合跑在 Kubernetes 上做反向代理和内网穿透。
An open-source alternative to Ngrok, designed to serve production traffic and be simple to host (particularly on Kubernetes)
开源版 Ngrok,用出站隧道把内网服务安全暴露到公网,专为生产流量和 Kubernetes 托管设计
用 Go 写的开源 Ngrok 替代品,专注承载生产流量,部署简单,特别适合跑在 Kubernetes 上做反向代理和内网穿透。
核心能力
- 上游服务主动建立出站隧道,无需公网端口
- 按 Host 首段或 x-piko-endpoint 头路由 HTTP 请求
- 同一端点多个上游自动做负载均衡
- 服务端可多节点集群,故障转移与零停机部署
- 提供 Prometheus 指标、访问日志和状态 API
容易踩的坑
- v0.10.1最新正式版2026-10-07 · 2026-10-07 15:29 UTC
Full Changelog: https://github.com/andydunstall/piko/compare/v0.9.1...v0.10.1
- v0.10.02026-05-08 · 2026-05-08 10:13 UTC
查看更新说明
What's Changed
- build(deps): bump github.com/golang-jwt/jwt/v5 from 5.3.0 to 5.3.1 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/303
- build(deps): bump github.com/MicahParks/keyfunc/v3 from 3.7.0 to 3.8.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/307
- build(deps): bump github.com/gin-gonic/gin from 1.11.0 to 1.12.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/309
- build(deps): bump golang.org/x/sync from 0.19.0 to 0.20.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/310
- build(deps): bump github.com/go-jose/go-jose/v4 from 4.1.3 to 4.1.4 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/311
- build(deps): bump go.uber.org/zap from 1.27.1 to 1.28.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/312
- stream: support configuring maximum window size by @shanehull in https://github.com/andydunstall/piko/pull/313
New Contributors
- @shanehull made their first contribution in https://github.com/andydunstall/piko/pull/313
Full Changelog: https://github.com/andydunstall/piko/compare/v0.9.0...v0.10.0
- v0.9.02026-01-25 · 2026-01-25 15:14 UTC
查看更新说明
What's Changed
- build(deps): bump github.com/stretchr/testify from 1.10.0 to 1.11.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/271
- build(deps): bump github.com/stretchr/testify from 1.11.0 to 1.11.1 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/273
- build(deps): bump github.com/spf13/pflag from 1.0.7 to 1.0.9 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/275
- build(deps): bump github.com/prometheus/client_golang from 1.23.0 to 1.23.2 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/276
- build(deps): bump github.com/spf13/pflag from 1.0.9 to 1.0.10 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/277
- build(deps): bump github.com/spf13/cobra from 1.9.1 to 1.10.1 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/279
- build(deps): bump golang.org/x/sync from 0.16.0 to 0.17.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/278
- build(deps): bump github.com/gin-gonic/gin from 1.10.1 to 1.11.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/280
- build(deps): bump github.com/MicahParks/keyfunc/v3 from 3.6.1 to 3.6.2 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/281
- build(deps): bump github.com/go-jose/go-jose/v4 from 4.1.2 to 4.1.3 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/285
- build(deps): bump github.com/MicahParks/keyfunc/v3 from 3.6.2 to 3.7.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/286
- Use tls.Dial() when forwarding a connection to a proxy with TLS configured by @jjcollinge in https://github.com/andydunstall/piko/pull/287
- build(deps): bump github.com/ugorji/go/codec from 1.3.0 to 1.3.1 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/288
- build(deps): bump golang.org/x/sync from 0.17.0 to 0.18.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/289
- build(deps): bump github.com/goccy/go-yaml from 1.18.0 to 1.19.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/292
- build(deps): bump go.uber.org/zap from 1.27.0 to 1.27.1 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/291
- build(deps): bump github.com/spf13/cobra from 1.10.1 to 1.10.2 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/293
- build(deps): bump github.com/goccy/go-yaml from 1.19.0 to 1.19.1 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/294
- demo: move demo from docs/demo to demo/ by @andydunstall in https://github.com/andydunstall/piko/pull/296
- agent: sort imports by @andydunstall in https://github.com/andydunstall/piko/pull/297
- server: remove usage reporting by @andydunstall in https://github.com/andydunstall/piko/pull/298
- build: update go to 1.25.5 by @andydunstall in https://github.com/andydunstall/piko/pull/299
- client: add support for graceful shutdown by @andydunstall in https://github.com/andydunstall/piko/pull/300
- build(deps): bump github.com/goccy/go-yaml from 1.19.1 to 1.19.2 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/302
New Contributors
- @jjcollinge made their first contribution in https://github.com/andydunstall/piko/pull/287
Full Changelog: https://github.com/andydunstall/piko/compare/v0.8.1...v0.9.0
- v0.8.12025-08-08 · 2025-08-08 07:14 UTC
查看更新说明
What's Changed
- workflow: fix docker build version by @andydunstall in https://github.com/andydunstall/piko/pull/270
Full Changelog: https://github.com/andydunstall/piko/compare/v0.8.0...v0.8.1
- v0.8.02025-08-08 · 2025-08-08 06:33 UTC
查看更新说明
What's Changed
- build(deps): bump golang.org/x/sync from 0.10.0 to 0.11.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/224
- build(deps): bump github.com/goccy/go-yaml from 1.15.17 to 1.15.19 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/225
- build(deps): bump github.com/spf13/cobra from 1.8.1 to 1.9.1 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/229
- build(deps): bump github.com/goccy/go-yaml from 1.15.19 to 1.15.23 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/228
- server: add upstream multi-tenant auth support by @andydunstall in https://github.com/andydunstall/piko/pull/208
- Allow for Proxy Server and Agent Access Log Config to be fine-grained. by @dipack95 in https://github.com/andydunstall/piko/pull/230
- log: add access log level by @andydunstall in https://github.com/andydunstall/piko/pull/231
- build(deps): bump github.com/prometheus/client_golang from 1.20.5 to 1.21.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/232
- build(deps): bump golang.org/x/sync from 0.11.0 to 0.12.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/238
- build(deps): bump github.com/prometheus/client_golang from 1.21.0 to 1.21.1 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/239
- build: update go to v1.24.1 by @andydunstall in https://github.com/andydunstall/piko/pull/241
- build(deps): bump github.com/golang-jwt/jwt/v5 from 5.2.1 to 5.2.2 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/243
- build(deps): bump github.com/goccy/go-yaml from 1.15.23 to 1.17.1 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/245
- build(deps): bump golang.org/x/sync from 0.12.0 to 0.13.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/244
- build(deps): bump github.com/prometheus/client_golang from 1.21.1 to 1.22.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/246
- Allow for HTTP transport customisations by @dipack95 in https://github.com/andydunstall/piko/pull/242
- build(deps): bump golang.org/x/sync from 0.13.0 to 0.14.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/248
- Support the TLS config for the agent client by @lewismarshall in https://github.com/andydunstall/piko/pull/247
- build(deps): bump github.com/gin-gonic/gin from 1.10.0 to 1.10.1 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/249
- build(deps): bump github.com/ugorji/go/codec from 1.2.12 to 1.2.14 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/252
- build(deps): bump github.com/goccy/go-yaml from 1.17.1 to 1.18.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/253
- build(deps): bump golang.org/x/sync from 0.14.0 to 0.15.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/254
- build(deps): bump github.com/ugorji/go/codec from 1.2.14 to 1.3.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/255
- build(deps): bump github.com/oklog/run from 1.1.0 to 1.2.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/256
- build(deps): bump golang.org/x/sync from 0.15.0 to 0.16.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/257
- agent: add connect.proxy-url flag by @andydunstall in https://github.com/andydunstall/piko/pull/237
- build(deps): bump github.com/golang-jwt/jwt/v5 from 5.2.2 to 5.2.3 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/261
- build(deps): bump github.com/spf13/pflag from 1.0.6 to 1.0.7 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/262
- build(deps): bump github.com/prometheus/client_golang from 1.22.0 to 1.23.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/265
- build(deps): bump github.com/golang-jwt/jwt/v5 from 5.2.3 to 5.3.0 by @dependabot[bot] in https://github.com/andydunstall/piko/pull/266
- 263: JWKS Support by @tscolari in https://github.com/andydunstall/piko/pull/267
- build: fi
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
What Is Piko?
Piko is a reverse proxy that provides a secure way to connect to services that aren’t publicly routable, known as tunneling. Instead of sending traffic directly to your services, your upstream services open outbound-only connections (tunnels) to Piko, then Piko forwards traffic to your services via their established connections.
Piko has two key design goals:
- Built to serve production traffic by running as a cluster of nodes for fault tolerance, horizontal scaling and zero-downtime deployments
- Simple to host behind a HTTP(S) load balancer on Kubernetes
Therefore Piko can be used as an open-source alternative to Ngrok.
Such as you may use Piko to expose services in a customer network, a bring your own cloud (BYOC) service, or to connect to user devices.
Reverse Proxy
In a traditional reverse proxy, you configure routing rules describing how to route incoming traffic to your upstream services. The proxy will then open connections to your services and forward incoming traffic. This means your upstream services must be discoverable and have an exposed port that's accessible from the proxy.
Whereas with Piko, your upstreams open outbound-only connections to the Piko server and specify what endpoint they are listening on. Piko then forwards incoming traffic to the correct upstream via its outbound connection.
Therefore your services may run anywhere without requiring a public route, as long as they can open a connection to the Piko server.
Endpoints
Upstream services listen for traffic on a particular endpoint. Piko then manages routing incoming connections and requests to an upstream service listening on the target endpoint. If multiple upstreams are listening on the same endpoint, requests are load balanced among the available upstreams.
No static configuration is required to configure endpoints, upstreams can listen on any endpoint they choose.
You can open an upstream listener using the
Piko agent, which supports
both HTTP and TCP upstreams. Such as to listen on endpoint my-endpoint and
forward traffic to localhost:3000:
# HTTP listener.
$ piko agent http my-endpoint 3000
# TCP listener.
$ piko agent tcp my-endpoint 3000
You can also use the Go SDK
to listen directly from your application using a standard net.Listener.
HTTP(S)
Piko acts as a transparent HTTP(S) reverse proxy.
Incoming HTTP(S) requests identify the target endpoint to connect to using
either the Host header or x-piko-endpoint header.
When using the Host header, Piko uses the first segment as the endpoint ID.
Such as if your hosting Piko with a wildcard domain at *.piko.example.com,
sending a request to foo.piko.example.com will be routed to an upstream
listening on endpoint foo.
To avoid having to set up a wildcard domain you can instead use the
x-piko-endpoint header, such as if Piko is hosted at piko.example.com, you
can send requests to endpoint foo using header x-piko-endpoint: foo.
TCP
Piko supports proxying TCP traffic, though unlike HTTP it requires using either Piko forward or the Go SDK to map the desired local TCP port to the target endpoint.
Piko forward listens on a local TCP port and forwards connections to the configured upstream endpoint via the Piko server.
Such as to listen on port 3000 and forward connections to endpoint
my-endpoint:
piko forward 3000 my-endpoint
Note unlike with HTTP, there is no way to identify the target endpoint when connecting with raw TCP, which is why you must first connect to Piko forward instead of connecting directly to the Piko server. Piko forward can also authenticate with the server and forward connections via TLS.
You can also use the Go SDK
to open a net.Conn that's connected to the configured endpoint.
Design Goals
Production Traffic
Piko is built to serve production traffic by running the Piko server as a cluster of nodes to be fault tolerant, scale horizontally and support zero downtime deployments.
Say an upstream is listening for traffic on endpoint E and connects to node N. Node N will notify the other nodes that it has a listener for endpoint E, so they can route incoming traffic for that endpoint to node N, which then forwards the traffic to the upstream via its outbound-only connection to the server. If node N fails or is deprovisioned, the upstream listener will reconnect to another node and the cluster propagates the new routing information to the other nodes in the cluster. See How Piko Works for details.
Piko also has a Prometheus endpoint, access logging, and status API so you can monitor your deployment and debug issues. See observability for details.
Hosting
Piko is built to be simple to host on Kubernetes. This means it can run as a cluster of nodes (such as a StatefulSet), supports gradual rollouts, and can be hosted behind a HTTP load balancer or Kubernetes Gateway.
Upstream services and downstream clients may connect to any node in the cluster via the load balancer, then the cluster manages routing traffic to the appropriate upstream.
See Kubernetes for details.
Getting Started
See Getting Started.
How Piko Works
See How Piko Works.
Support
Use GitHub Discussions to ask questions, get help, or suggest ideas.
Docs
See Wiki.
Contributing
See CONTRIBUTING.
License
MIT License, please see LICENSE for details.