top | item 38901674

(no title)

timmattison | 2 years ago

You knowing your subnet is not the issue. The other party needs to know it.

WebRTC needs info about where to try to connect. It doesn’t specify the signaling method which is how you get that information and share it.

If you’re already on the same subnet, use mDNS.

If you’re on different subnets it requires some kind of way to share the subnet info.

If you’re on different networks behind NAT then scanning isn’t very helpful. You’d need to scan IPs and ports because NAT randomizes the outbound ports. That’s what STUN helps you figure out. Once you’ve got that info and you build the session description structure you can send that to the other party however you want.

Public, free STUN servers exist. And people use them for all kinds of WebRTC stuff.

Neither WebRTC nor WebSockets prevent pure P2P. It sounds like your bigger issue is with NAT. IPv6 isn’t going to fix it though since the IP space will be too large to scan for peers.

discuss

order

lostmsu|2 years ago

> You knowing your subnet is not the issue. The other party needs to know it.

You misunderstood, knowing subnet is an option for discovery of nearby peers. If you know your subnet you can scan it in reasonable amount of time. Otherwise you'd have to scan the whole IPv4 space (or worse IPv6 space).

> WebRTC needs info about where to try to connect. It doesn’t specify the signaling method which is how you get that information and share it.

Yes.

> If you’re already on the same subnet, use mDNS.

You can't - you are in the browser.

> If you’re on different subnets it requires some kind of way to share the subnet info.

Yes, that's how connections are established with an intermediary signaling service. The p2p question is about possibility of establishing WebRTC connection without a signaling service that runs over something else and/or requires a centralized server.

timmattison|2 years ago

I use WebRTC in non-browser applications primarily. For those systems you can use mDNS.

I have been working on WebRTC a lot lately. If you have ideas on how you’d solve this issue I’d take a stab at implementing them.

I’ve built a demo that lets you get two systems connected by copying and pasting the session description information. No third party systems required. But you still need to get your clipboard data to someone else. Which usually means SMS, Apple Messages, etc.