Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

webRTC matchmaking URI scheme proposal #brainstorm #82

Open
coderofsalvation opened this issue Jul 23, 2024 · 1 comment
Open

webRTC matchmaking URI scheme proposal #brainstorm #82

coderofsalvation opened this issue Jul 23, 2024 · 1 comment

Comments

@coderofsalvation
Copy link

coderofsalvation commented Jul 23, 2024

In xrfragment.org buttons have link-values which trigger a trystero connection:

  • trystero://r/myroom:webtorrent e.g.

By using URI's, the content can prime the trystero-configuration popup (presets).
This enables content to 'bring their own network', instead of apps locking users into theirs.

With that in mind, the eventual protocol is merely used as a commons for Peer Discovery.
Afterwards, the 'app' decides how to manage data between peers via WebRTC protocol right? (it seems we're using 1% of the protocol, just the frontdoor to look who's inside).

Since trystero is quite a new protocol-agnostic concept, and imaging that other services (XMPP, SIP, IRC,Matrix) could be added as well, how crazy is the idea of a flexible webRTC matchmaking URI scheme:

  • p2p://[password@]{room}?[server=...][&protocol=....]
@coderofsalvation coderofsalvation changed the title meta URI scheme proposal #brainstorm webRTC matchmaking URI scheme proposal #brainstorm Jul 23, 2024
@coderofsalvation
Copy link
Author

coderofsalvation commented Aug 4, 2024

UPDATE

actually the magnet URI RFC already is exactly that for webtorrent, and the other protocols also have their URI specs.

Is it an idea to let trystero-instance (user A) output an URL which can configure the protocol of another trystero-instance (user B) on the fly?

idea: url config key

const room = joinRoom({
  appId: 'san_narciso_3d', 
  // optional, in case enduser received a trystero SHARE URL:
  url: ""magnet:?xt=urn:bti:1234567890abcdef1234567890abcdef12345678&dn=MYROOMID"
})

/*
 * // trystero can infer protocol from URL
 * let url = new URL(config.url)
 * if( url.protocol == 'magnet:' && url.searchParams.get('dn') ){ // detect webtorrent
 *    room.id = url.searchParams.get('dn')
 * }
 * if( url.protocol == 'ipfs:' ){   .... }
 * opts.URL = url
 */

// this url can be shared:
console.log( room.url )
// 'magnet:?xt=urn:bti:1234567890abcdef1234567890abcdef12345678&dn=MYROOMID'

console.log( room.URL.protocol )
// 'webtorrent'
// in case of ipfs, it would output ipfs://.....   e.g.

is this an interesting way of allowing trystero to share protocol-specific rooms via URI's ?
(that way, a trystero app-developer doesn't have to bet on one horse during pageload anymore)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant