Skip to content
anyplaynetPublic

About

Online play for AnyPS5 games: design, specifications and the bridge protocol.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

AnyPlay Network

The network behind AnyPlay: accounts, friends, parties, voice, screen sharing and encrypted connections between players over the internet. Players open no ports and need no shared LAN. The network never contacts a platform holder's servers.

This repository holds the net service that runs on each player's PC, the protocols it speaks and the design behind them. It is built for games that run on AnyPS5, a compatibility layer (not an emulator) by boykopovar and contributors. You play only games you own.

How the parts fit

Part Where What it does
Net service this repository Runs beside the launcher on each PC. Keeps the account, the connection to the cloud, the tunnels, party voice and screen sharing.
Launcher its own repository Starts the net service and shows the online area: friends, messages, parties, share screen.
Cloud its own repository Accounts, friends, presence, sessions, invitations, moderation and relays. Runs at anyplaynet.com.
Bridge AnyPlay's fork of AnyPS5 A small layer inside AnyPS5's system libraries that hands a game's sign-in, session and web API calls to the net service. Off unless the launcher switches it on for one game start.

AnyPS5 already replaces a console's system libraries with its own code, so the line between a game and the network is a function call, not traffic on a wire. The network plugs in at that call:

 Player A's PC                                    Player B's PC
 ┌─────────────────────────┐                      ┌─────────────────────────┐
 │ game                    │                      │ game                    │
 │  └ AnyPS5 libraries     │                      │  └ AnyPS5 libraries     │
 │     └ bridge            │                      │     └ bridge            │
 │         │ loopback      │                      │         │ loopback      │
 │ launcher ─ net service ◄┼──── tunnel (QUIC) ───┼► net service ─ launcher │
 └────────────┬────────────┘   direct or relay    └────────────┬────────────┘
              │                                                │
              └─────────── HTTPS requests, one WebSocket ──────┘
                                       │
                                     cloud
                 accounts · friends · presence · sessions · invitations
                          moderation · relay tickets · relays

Use it

Players get the network through the AnyPlay Launcher, which starts the net service itself. To measure a tunnel between two networks, for example your home and a phone's hotspot:

cargo run --release -p anyplay-probe -- listen          # on one side; prints a ticket
cargo run --release -p anyplay-probe -- connect <ticket> # on the other

It reports whether the tunnel went direct or through a relay, the round trip, loss, jitter and throughput. Add --relay-only on either side to measure the relayed path. listen --key <file> keeps the listener's identity in a file (created with mode 0600 when missing), so the ticket stays the same when the listener restarts; without it every start makes a new ticket. The probe uses the iroh project's public relays. Only probe packets cross them.

What's inside

Path What it is
crates/net anyplay-net, the net service on each player's PC: account, cloud connection, bridge server, tunnels, voice and screen sharing
crates/bridge-protocol the messages between the bridge and the net service
crates/control the messages between the launcher and the net service
crates/api the cloud's API, shared by the net service and the cloud
crates/voice anyplay-voice, the party voice engine
crates/fake-game anyplay-fake-game, a game's side of the bridge, for tests and for trying the network without a game
crates/share, crates/share-worker the share-screen media path, and the worker program that captures, encodes and shows the picture
crates/discord an optional Discord Social SDK seam, off by default (ADR 0022)
crates/probe anyplay-probe, which measures a tunnel
spec/ the network's own specifications: bridge protocol, control protocol, cloud API, portal API, web API groups and more
docs/ design, social layer, decisions, which games can play online, privacy and security, how games are observed, known gaps, supply chain

What works today

The network without games is live at anyplaynet.com, and the launcher uses it.

Area State
Accounts, friends, presence, messages, notifications Done and live.
Parties with voice and push to talk Done and live.
Share screen to a party Done. Game sound is Windows only.
Broadcast to Twitch, YouTube or RTMP Done on Windows, with the game's sound; rtmp:// and rtmps://.
Join links, Find Players, captures and clips sent to friends Done.
Bridge: sign-in, identity, NAT type, web API forwarding, push events, online-permission check, peer-to-peer datagrams and streams Merged in the fork. The end-to-end CI that runs the bridge against the net service is in review.
Web API groups answered for games userProfile and communicationRestrictionStatus. Every other group is refused and logged.
A first game played together over the internet Not yet. This is phase 4 of the roadmap.
Measuring tunnels between two real networks Waiting for a second network (phase 0).
Share play (taking over a friend's pad) Designed, not built.
Several cloud nodes Not built. The cloud runs as one node.

docs/gaps.md lists what each part still lacks.

The line

The network goes as far as the law allows and no further (ADR 0021). It never contacts Sony's servers, uses Sony's code, keys or leaked documents, issues tokens for a platform or a publisher, poses as a console, or bypasses anti-cheat or copy protection. Formats are learned by observing games the player owns and written down as our own specifications. Names carry no platform trademarks. A game is a test case for a generic feature, never a feature of its own.

Build and contribute

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace

Every pull request runs these on Windows and Linux. The parsers are fuzzed every night (fuzz/). Start with the design; the words are in CONTEXT.md. Issues and pull requests are welcome; see CONTRIBUTING.md. The rules shared by every AnyPlay repository are in the organisation's CONTRIBUTING.md.

macOS

cargo build --release --locked -p anyplay-net --features devices builds a native service with CoreAudio microphone and speaker support. CI builds and tests it on macOS as well as Windows and Linux. The launcher embeds the matching binary at build time with ANYPLAY_NET_EMBED and starts it over standard input/output with an explicit per-user data folder.

Run standalone with --data <folder> or use its default under ~/Library/Application Support/AnyPlay/net. Sign-ins use the macOS Keychain when available; --file-credentials is intended for isolated tests. Microphone access belongs to the launcher app's privacy prompt. Share-screen capture and Discord's optional SDK are separate platform integrations; this does not add them or a game engine bridge.

Community

Questions and ideas: the AnyPlay Discord. More about AnyPlay at anyplaynet.com.

License

MIT or Apache-2.0, at your option, so that AnyPS5 (GPL-2.0) and the cloud (AGPL-3.0) can both use these crates.

AnyPlay is a community project, not affiliated with the AnyPS5 maintainers or any platform holder. Only games you own.

About

Online play for AnyPS5 games: design, specifications and the bridge protocol.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages