[libnice] Ignore host candidates for testing

Felix Schlitter felixschlitter at gmail.com
Tue Jun 23 02:09:40 PDT 2015


Hi,

I am wondering if it is possible to force libnice to ignore host candidates?
I have a use case where I would like to test the connection locally on the
same machine as if there were actually two machines involved:

```
+--------------------+
| Desktop            |
|----------+---------|
|  Peer L  | Peer R  |
+----------+---------+
    ^          |
    |          |
    |          V
+---o----------o----+
|        NAT        |
+---o----------o----+
    |          |
     \<------</
```

I have written a simple program that creates two agents on two threads
and then connects them using `nice_agent_generate_local_sdp(...)` and
`nice_agent_parse_remote_sdp(...)`.

I have then just added a pretty whacky step where it would remove all
`typ host` candidates from the offer. It's pretty crude, and probably
completely
wrong, but I have seen no exported api to achieve this otherwise.

I have hosted the sample program as a gist on github:
https://gist.github.com/felixSchl/1a8926689bc363e47a3b
It should just compile. I compiled against libnice 0.1.13 on OSX.

Regards,

Felix Schlitter

PS: It would be great to see this project hosted on github... using the
mailing
list is pretty off-putting - the search function does not seem to work, so
I could not search
if someone had asked sth like this before, unless I click manually through
5 years
worth of threads... Also submitting pull requests would be a lot easier
than attaching patches
which may go stale. I would be happy to volunteer time to help this
transition.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nice/attachments/20150623/2fb1e7cb/attachment.html>


More information about the nice mailing list