It leverages both Wifi and Bluetooth locally
FYI, Apple’s peer-to-peer networking [1] hasn’t used Bluetooth in a while (iOS 9 maybe?).
Beyond that, there's WebSocket support in URLSession
these days
URLSession
has WebSocket client support, but for peer-to-peer you need both client and server. For that you need Network framework. Honestly, it’s a better option anyway (-:
Network framework supports peer-to-peer networking, WebSocket client and server, and PSK (shared secret) TLS. That’s my go-to combination for this sort of thing. Check out Building a Custom Peer-to-Peer Protocol.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] “Peer-to-peer” has a bunch of different meanings depend on the context. In this context I’m using it to refer to infrastructure-less networking, that is, communicating between two nearby peers that don’t share any common infrastructure, for example, are not on the same infrastructure Wi-Fi network.