Skip to content

A websocket server used to accept com.atproto.sync.subscribeRepo calls, and polls the IC PDS canister for updates

License

Notifications You must be signed in to change notification settings

edjCase/atproto_pds_ws_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

atproto_pds_ws_server

A WebSocket server that accepts AT Protocol com.atproto.sync.subscribeRepos connections and polls the IC PDS canister for updates, broadcasting them to connected clients.

Features

  • WebSocket server accepting connections on /xrpc/com.atproto.sync.subscribeRepos
  • Polls a configurable canister endpoint every 1 second
  • Broadcasts updates as AT Protocol commits with incremental sequence numbers
  • Handles client connections and disconnections gracefully
  • Comprehensive activity logging
  • Configurable via environment variables
  • Ready for Fly.io deployment

Installation

npm install

Usage

Local Development

Start the server:

npm start

The server will listen on port 8080 by default.

Configuration

Configure the server using environment variables:

Example:

PORT=3000 CANISTER_URL=https://mycanister.ic0.app/updates npm start

Connecting Clients

Connect using any WebSocket client to:

ws://localhost:8080/xrpc/com.atproto.sync.subscribeRepos

Clients will receive updates in AT Protocol format:

{
    "$type": "com.atproto.sync.subscribeRepos#commit",
    "seq": 1,
    "ops": [
        {
            "action": "create",
            "path": "app.bsky.feed.post/abc123"
        }
    ]
}

License

MIT

About

A websocket server used to accept com.atproto.sync.subscribeRepo calls, and polls the IC PDS canister for updates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •