i suppose you could try adding something to do the networking part via webrtc as the channel?
Nothing in the web platform lets you use raw (or TCP/UDP/etc) sockets. At most you could do VPN-style networking and use a bridge to talk to the rest of the internet; that bridge needs someone to host it.