Really? WebRTC DataChannels seem like they could fulfill your needs. What is it that prevents using something like WebRTC Data Channels and forces you to use TCP based connections?
And the second part of it is - I'm sure its easily done but at this point there is some incentive to keep whatever implementation you have to yourself.
Or maybe I missed something and I should try looking into it again.