Skip to content

edjCase/atproto_pds_ws_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 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:

  • DOMAIN - Domain to poll for updates (Required)
  • PORT - Server port (Optional, default: 8080)

Example:

PORT=8080 DOMAIN=my-domain.com 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

 
 
 

Contributors