An ATproto-compliant relay server implementation written in Rust.
This project implements an ATproto relay that allows you to participate in the AT Protocol network. It handles subscription to repository updates via the com.atproto.sync.subscribeRepos endpoint and provides relay functionality to other services.
- Rust and Cargo
- Python 3 (for running the crawler script)
- SSL certificates (optional, for HTTPS support)
websocat(for testing WebSocket connections)
git clone https://github.com/yourusername/rsky-relay.git
cd rsky-relaycargo build --releaseThe crawler script collects necessary data from the network:
cd rsky-relay
uv init .
uv add requests
uv run python3 crawler.pyNote: You can stop the crawler after a few requests and then run the relay with the --no-plc-export flag.
If you want to use HTTPS, generate SSL certificates using the provided script:
./ssl.sh <local ip>To find your local IP address, you can use:
ip aNote: You can skip this step if you don't need HTTPS. In that case, don't specify -c and -p options when running the relay.
Start the relay server with debug logging:
RUST_LOG='rsky_relay=debug' cargo run -rp rsky-relay -- -c <local ip>.crt -p <local ip>.keyFor non-HTTPS mode:
RUST_LOG='rsky_relay=debug' cargo run -rp rsky-relayYou can test the WebSocket connection using websocat:
websocat -k wss://localhost:9000/xrpc/com.atproto.sync.subscribeRepos?cursor=0You can test the HTTP endpoints using curl:
curl https://localhost:9000/xrpc/com.atproto.sync.listHosts?limit=10-c, --cert <FILE>: Path to SSL certificate file-p, --key <FILE>: Path to SSL private key file--no-plc-export: Run the relay without requiring PLC export data (useful after running the crawler for only a short time)
rsky-relay uses the RUST_LOG environment variable to control log levels. Example:
RUST_LOG='rsky_relay=debug' cargo run -rp rsky-relay