Component evidence
Logs Centrifuge server events to standard output.
// Source: https://github.com/centrifugal/centrifuge | License: MIT | Copyright 2023 Centrifugal Labs LTD
// Provided via justclaw.it.com; keep this notice with the code.
package main
import (
"context"
"errors"
"flag"
"log"
"net/http"
"os"
"os/signal"
"strings"
"syscall"
"time"
"github.com/centrifugal/centrifuge"
)
func handleLog(e centrifuge.LogEntry) {
log.Printf("[centrifuge] %s: %v", e.Message, e.Fields)
}
var (
port = flag.String("port", "3000", "HTTP server port")
redisAddr = flag.String("redis", "", "Redis address (e.g., localhost:6379). If empty, uses in-memory broker.")
)
func main() {
flag.Parse()
node, err := centrifuge.New(centrifuge.Config{
LogLevel: centrifuge.LogLevelDebug,
LogHandler: handleLog,
GetChannelMediumOptions: func(channel strin
... (truncated -- full source via MCP)