Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello Iroh FFI

A minimal presence demo over iroh, implemented in parallel on iOS/macOS and Android. Each platform is a self-contained app that speaks the same wire format, so a Swift peer and a Kotlin peer can share a screen.

Two devices mirroring each other's dot in real time

Platform Language Status Details
iOS + macOS Swift / SwiftUI working swift/README.md
Android Kotlin / Jetpack Compose working kotlin-android/README.md
Console reader Python working python/README.md
Console reader JavaScript (Node) working js/README.md

Both implementations consume iroh-ffi from public registries: Swift Package Manager on Apple platforms, Maven Central on Android. No Rust toolchain or local iroh-ffi checkout is needed. Read more about the language bindings at docs.iroh.computer/languages.

How the demo works

Each peer controls one dot in a shared coordinate space. You move your dot by tilting the phone or dragging on the desktop, and you stream its position to the other peer at ~60 Hz over an iroh bi-directional stream. The peer renders your dot at the same coordinates next to its own, so both screens show the two dots tracking each other in real time.

The two peers are fully symmetric. There is no game, no score, and no authority role: each side sends its own position and renders the other's. Discovery is manual: copy your endpoint id, paste it on the other peer, tap Connect.

While connected, a line under the status shows the connection's live network paths — direct vs relay, remote address, and RTT — so you can watch iroh hole-punch its way from a relayed connection to a direct one.

Wire format

A single bi-directional stream carries one frame type, sent continuously by both peers:

Frame Size Layout
Position 8 B f32 x, f32 y

Both coordinates are in [-1, 1], little-endian, and shared directly: the peer renders your dot at the position you send. With only one message type there is no tag byte, so the receive loop reads a fixed 8 bytes per frame.

ALPN: iroh-helloiroh-dot/0.

Repo layout

hello-iroh-ffi/
├── README.md
├── demo.gif
├── swift/              iOS + macOS app (Swift / SwiftUI)
├── kotlin-android/     Android app (Kotlin / Jetpack Compose)
├── python/             headless console reader (Python)
└── js/                 headless console reader (JavaScript / Node)

Further reading

License

MIT

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages