uProxy/turn-relay — pull request #20 by trevj (2014-06-24 22:35:55+00:00)
Title: use STUN messages for TURN <-> net module communication

This makes the TURN server use STUN messages for inter-module communication.

Previously, we've been sending string-ified JSON which is horrendously inefficient, e.g. 100 bytes can blow up to 600 bytes in the presence of many "unprintable" characters.

Now, we essentially just forward the original STUN message from the client onto the net module (and vice versa, for replies).

The one tricky thing about this was preserving a request's origin address -- this is essential for the net module to associate SEND indications with relay sockets (and vice versa, for DATA indications). I've implemented this with the help of a new STUN attribute, IPC_TAG, which contains the client's address.

Tested with turnutils_uclient.