tags:

views:

649

answers:

5
+1  Q: 

NAT Traversal

I am trying to build a peer to peer application. I would like to know how I can accomplish nat traversal in c++. Is there any good library in c++ for this. Or any coding examples, books, links.... anything.

A: 

You could have a look at JXTA, I'm pretty sure they have bindings for C at least.

Update: You can find the project page for C/C++ and C# JXTA binding here.

Cogsy
I am looking for a library purely written in c++.
rahul
JXTA is a collection of XML based protocols - making it language independent. The reference implementation is in Java, but other implementations are available for different languages.
Cogsy
JXTA doesn't appear to have solved the only real hard part of p2p... UDP NAT traversal.
Jurney
+1  A: 

You can start with STUNT.

Since many modern broadband routers support uPnP and (a much cleaner) NAT-PMP, you can try working with those as well, using, for example, libnatpmp.

macbirdie
Nice. But a C++ api would be nicer.
rahul
A: 

Eyeball Networks Anfirewall Engine provides a NAT Traversal API written in c++. You can download a demo version at developer.anyfirewall.com.

A: 

A few years ago Skype published their strategy for NAT traversal. Reading it gave me quite a few "AHA" moments and really clarified a lot of things.

Unfortunately, I can't find that web page anywhere. If someone has a reference to it please could you link it?

rein
A: 

The OpenH323 and OPAL projects have STUN support.

Joseph