johanhelsing / matchbox

Painless peer-to-peer WebRTC networking for rust wasm (and native!)
Apache License 2.0
868 stars 70 forks source link

Add API for checking whether a peer is connected through a relay server #334

Open johanhelsing opened 11 months ago

johanhelsing commented 11 months ago

I want this because I want to tell my players why their latency is bad.

It looks hairy, but doable. Not sure what the API will be.

simbleau commented 11 months ago

I'm just curious, but why not just an API to negotiate ping to a specific peer?

Ideally without needing to negotiate the answer/offer first! I want to tell users the best servers (peers) by ping on a world list before they connect.

I currently do this with an HTTP call, which has overhead and isn't representative of p2p ping.

johanhelsing commented 11 months ago

Ideally, we'd have ping available through the same API, but not critical for me, as I already get it through ggrs.