an app.bsky.* indexer
1package main 2 3import ( 4 "context" 5 "net/http" 6 7 "github.com/gorilla/websocket" 8) 9 10func NewFirehoseConnection(ctx context.Context, cursorSvc *CursorService) (*websocket.Conn, error) { 11 url := "wss://bsky.network/xrpc/com.atproto.sync.subscribeRepos" 12 curs, _ := cursorSvc.Get("firehose") 13 if curs != "" { 14 url += "?cursor=" + curs 15 } 16 17 conn, _, err := websocket.DefaultDialer.DialContext(ctx, url, http.Header{ 18 "User-Agent": []string{"backfiller/0.1 (@edavis.dev)"}, 19 }) 20 if err != nil { 21 return nil, err 22 } 23 24 return conn, nil 25}