I don't understand how this works. It seems like when you're connected to the ad-hoc wifi network, all web requests would go through there. How do they get around this?
I'm assuming they're making use of the fact that the iPhone is multihomed when wifi and cellular connections are both enabled. This means that any outboard traffic from iOS could take two routes, but the ad-hoc wifi network is only advertising routes to IP addresses in a (predetermined) private address space. So when the websockets app talks to a private IP address it choses the wifi route and when it talks to a public IP address it choses the cellular route.