Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
W

whoami

> 编程语言
Open source

Tiny Go server that prints os information and HTTP request to output

1.4K stars0 likes0 views
WebsiteGitHub

About

Tiny Go server that prints os information and HTTP request to output

whoami

Tiny Go webserver that prints OS information and HTTP request to output.

Usage

Paths

/[?wait=d]

Returns the whoami information (request and network information).

The optional wait query parameter can be provided to tell the server to wait before sending the response. The duration is expected in Go's time.Duration format (e.g. /?wait=100ms to wait 100 milliseconds).

The optional env query parameter can be set to true to add the environment variables to the response.

/api

Returns the whoami information (and some extra information) as JSON.

The optional env query parameter can be set to true to add the environment variables to the response.

/bench

Always return the same response (1).

/data?size=n[&unit=u]

Creates a response with a size n.

The unit of measure, if specified, accepts the following values: KB, MB, GB, TB (optional, default: bytes).

/echo

WebSocket echo.

/health

Heath check.

  • GET, HEAD, ...: returns a response with the status code defined by the POST
  • POST: changes the status code of the GET (HEAD, ...) response.

Flags

Flag Env var Description
cert Give me a certificate.
key Give me a key.
cacert Give me a CA chain, enforces mutual TLS
port WHOAMI_PORT_NUMBER Give me a port number. (default: 80)
name WHOAMI_NAME Give me a name.
verbose Enable verbose logging.

Examples

$ docker run -d -p 8080:80 --name iamfoo traefik/whoami

$ curl http://localhost:8080
Hostname: 9c9c93da54b5
IP: 127.0.0.1
IP: ::1
IP: 172.17.0.2
RemoteAddr: 172.17.0.1:41040
GET / HTTP/1.1
Host: localhost:8080
User-Agent: curl/8.5.0
Accept: */*
# updates health check status
$ curl -X POST -d '500' http://localhost:8080/health

# calls the health check
$ curl -v http://localhost:8080/health
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> GET /health HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.5.0
> Accept: */*
> 
< HTTP/1.1 500 Internal Server Error
< Date: Fri, 18 Apr 2025 13:36:02 GMT
< Content-Length: 0
…
$ docker run -d -p 8080:80 --name iamfoo traefik/whoami

$ grpcurl -plaintext -proto grpc.proto localhost:8080 whoami.Whoami/Whoami
{
  "hostname": "5a45e21984b4",
  "iface": [
    "127.0.0.1",
    "::1",
    "172.17.0.2"
  ]
}

$ grpcurl -plaintext -proto grpc.proto localhost:8080 whoami.Whoami/Bench
{
  "data": 1
}
version: '3.9'

services:
  whoami:
    image: traefik/whoami
    command:
       # It tells whoami to start listening on 2001 instead of 80
       - --port=2001
       - --name=iamfoo

GitHub Issues· 0 open

View all on GitHub

No open issues yet, or sync has not completed.

> Tags

Gogogolangwhoami

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言