package websocket import ( "html/template" "net/http" ) var indexTemplate = template.Must(template.New("index").Parse(` Nostr gRPC Relay

⚡ Nostr gRPC Relay

High-performance relay with multi-protocol support

Protocols

🔌 gRPC (Native Binary)

{{.GrpcAddr}}

High-performance binary protocol for applications

🌐 Connect (HTTP/JSON)

{{.HttpAddr}}/nostr.v1.NostrRelay/*

Browser-compatible gRPC over HTTP with JSON

🔗 WebSocket (Nostr Protocol)

ws://{{.WsAddr}}/

Standard Nostr protocol (NIP-01) for all clients

Supported NIPs

NIP-01 NIP-09 NIP-11

Features

  • Binary-first storage (Protocol Buffers)
  • SQLite with WAL mode
  • Event validation (ID & signature)
  • Real-time subscriptions
  • Event deletion (NIP-09)
`)) type IndexData struct { GrpcAddr string HttpAddr string WsAddr string } func (h *Handler) ServeIndex(w http.ResponseWriter, r *http.Request, data IndexData) { w.Header().Set("Content-Type", "text/html; charset=utf-8") indexTemplate.Execute(w, data) }