On Tuesday, 29 April 2014 at 01:21:36 UTC, Vladimir Panteleev
wrote:
On Monday, 28 April 2014 at 18:36:59 UTC, Radu wrote:
Every time I read anything related to STUN/TURN, it becomes
obvious that these technologies were designed by some
committee. Metric tons of technical jargon and bureaucratic
overhead with an absurdly overcomplicated protocol to achieve
such a simple thing.
I implemented basic concept behind the TURN server, a TCP relay:
http://worms2d.info/WormNAT2
The protocol is much simpler. As soon as a connection is
received, it allocates a port and sends it to the client. This
is the public port allocated for the connection - peers wishing
to connect to the client can connect to that port on the relay
server and talk as if they were talking to the client directly.
Every time a peer connects, the server allocates a temporary
port for the client to connect to, and sends it over the
original control connection. After the client connects to said
port, they can start talking to the peer directly, as if
there's no proxy in-between. This avoids complicated
handshakes, headers, and having to modify your protocol and
wrap every single packet in a stupid header. It's also based on
TCP, so you don't have to reimplement reordering,
retransmission etc. on top of UDP all over again.
It's not open-source, and although I could share the source
code, it's not Vibe'd (D1 in fact). The implementation is very
simple, though.
Vibed is in D1? Are you sure? I can't seem to find any mention of
that, it works with the current DMD, but then again I've never
tried to compile a D1 program with it.
Thhanks for you're answer, but I was looking for something a
little more comprehensive, something that will work with WebRTC,
that means binary or encoded messages, audio and video
communication. It may seem hard to understand of you read the
official documents but there are server examples written in C,
C++, Java, Python, Erlang and node.js all open-source. I was
hoping to find one written in D too. Oh well...