A small, simple web hook server in Go for sending downlinks via chirpstack4
  • Go 79.9%
  • HTML 20.1%
Find a file
2026-07-07 23:30:08 +02:00
cmd/webhook first commit 2026-07-07 23:30:08 +02:00
downlink.go first commit 2026-07-07 23:30:08 +02:00
go.mod first commit 2026-07-07 23:30:08 +02:00
go.sum first commit 2026-07-07 23:30:08 +02:00
LICENSE first commit 2026-07-07 23:30:08 +02:00
README.md first commit 2026-07-07 23:30:08 +02:00
README_loranam.html first commit 2026-07-07 23:30:08 +02:00
README_loranam.md first commit 2026-07-07 23:30:08 +02:00
webhook first commit 2026-07-07 23:30:08 +02:00

cs4apiproxy

HTTP webhook proxy for enqueuing ChirpStack LoRaWAN downlinks via gRPC.

Binaries

cmd/webhook

HTTP server that translates REST-style webhook calls into ChirpStack gRPC DeviceService.Enqueue requests. All downlink operations and errors are logged with the requesting client's IP address.

Endpoints:

Method Path Behaviour
POST /devices/{devEUI}/down/push Enqueue downlink(s)
POST /devices/{devEUI}/down/replace Flush existing queue, then enqueue downlink(s)

Request format:

{
  "downlinks": [
    {
      "frm_payload": "vu8=",
      "f_port": 15,
      "confirmed": true
    }
  ]
}
  • frm_payload — base64-encoded payload (decoded before forwarding to gRPC).
  • f_port — LoRaWAN FPort (must be > 0).
  • confirmed — whether the downlink is confirmed (optional, defaults to false).

Authentication:

The ChirpStack API token is passed in the Authorization: Bearer <token> (or X-API-Token) header. The server forwards the same token to the gRPC Enqueue call as bearer credentials.

Options:

Flag Env Default
-server CHIRPSTACK_SERVER 192.168.2.23:8080
-http HTTP_ADDR :8080

Example:

go run ./cmd/webhook/ -server 192.168.2.23:8080 -http :8080

curl -X POST http://localhost:8080/devices/3333333333333333/down/push \
  -H "Authorization: Bearer eyJ0eXAiOiJKV1Qi..." \
  -H "Content-Type: application/json" \
  -d '{"downlinks":[{"frm_payload":"vu8=","f_port":15}]}'

Standalone CLI tool that enqueues a single hardcoded downlink. Used as a reference / one-off test.

License

AGPL-3.0 — see LICENSE.