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.