{"id":31701939,"url":"https://github.com/getlantern/natty","last_synced_at":"2026-03-10T04:31:27.592Z","repository":{"id":14111321,"uuid":"16816021","full_name":"getlantern/natty","owner":"getlantern","description":"Standalone WebRTC-based NAT traversal","archived":false,"fork":false,"pushed_at":"2018-08-10T11:38:53.000Z","size":15614,"stargazers_count":98,"open_issues_count":9,"forks_count":22,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-10-28T11:58:37.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getlantern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-13T20:25:35.000Z","updated_at":"2025-09-18T11:48:24.000Z","dependencies_parsed_at":"2022-07-15T15:17:33.143Z","dependency_job_id":null,"html_url":"https://github.com/getlantern/natty","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/getlantern/natty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Fnatty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Fnatty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Fnatty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Fnatty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getlantern","download_url":"https://codeload.github.com/getlantern/natty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Fnatty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30324389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-08T21:10:16.943Z","updated_at":"2026-03-10T04:31:27.585Z","avatar_url":"https://github.com/getlantern.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# natty\n\nStandalone WebRTC-based NAT traversal\n\nWith peer-to-peer communication, a set of tools to directly connect two\nendpoints is employed to bypass the intermediary barriers of NAT/firewall\ndevices. [WebRTC](http://www.webrtc.org/webrtc-native-code-package), a new\nproject that enables real-time communication capabilities in web browsers, uses\na trio of NAT traversal standards--ICE, STUN, and TURN--to help a peer discover\nthe topology between itself and the peer it wishes to communicate with. These\nstandards help to determine the best route possible, if it exists, through a\ngiven network topology.\n\nNatty extracts these NAT traversal tools as implemented in the WebRTC source.\nIn keeping with the standard itself, natty remains agnostic to signaling\nspecifics. It forwards messages between a caller and signaler, facilitating an\noffer/answer exchange, and concentrates entirely on the NAT traversal process.\n\nNatty relies almost entirely on the ICE framework to perform NAT traversals.\nICE works, for a given peer, by gathering a prioritized list of possible IP\naddress and port candidates. This list of candidates is accumulated by natty and\nforwarded to the signaling intermediary. Once a full set of candidate pairs is\navailable on a specific endpoint, natty relies on ICE to perform a series of\nconnectivity checks. When/if a connectivity check succeeds, and a connection is\nsuccessfully established, natty outputs the resultant 5-tuple(s) on both sides.\nNatty, by default, consumes and returns JSON messages. After multiple rounds of\ntests, if no pair is found, natty assumes no working candidate pair for\nconnecting the peers exists and returns an error message, assuming some fallback\nmechanism is subsequently necessary.\n\n## Installation\nThese instructions are also available in the webrtc-setup file. \n\nFirst, checkout and build the WebRTC source:\n```bash\nmkdir build\ncd build\ngclient config --name src 'git+https://chromium.googlesource.com/external/webrtc'\ngclient sync -j200\ncd src\ngit svn init --prefix=origin/ https://webrtc.googlecode.com/svn -T/branches/3.55/webrtc@6541 --rewrite-root=http://webrtc.googlecode.com/svn\ngit svn fetch\ngit checkout master\n```\n\nCopy over natty patch and *.gyp files. Then generate build files:\n```bash\npatch talk/session/media/channel.cc \u003c ../../src/webrtc/channel.patch\ncp gyp/* build/src\n```\n\nBuilding natty\n```\nninja -C build/src/out/Release\n```\n\nIf all goes well, the natty binary should be available in the\nbuild/src/out/Release directory.\n\n### Usage\nYou communicate with a natty process over stdin/stdout.\n\n```bash\n   ./natty\n    -offer (used on the initiator side)\n    -debug (output debugging info)\n    -out (re-direct output to file; assumes stdout by default)\n```\nHere's an example session:\n```\n./natty -offer -out offerer\ncat offerer\n{\"sdp\":\"v=0\\r\\no=- 4872732101493451958 2 IN IP4 127.0.0.1\\r\\ns=-\\r\\nt=0 0\\r\\na=msid-semantic: WMS\\r\\nm=application 9 DTLS/SCTP 5000\\r\\nc=IN IP4 0.0.0.0\\r\\na=ice-ufrag:t/JZ+l7sDBx99Zcy\\r\\na=ice-pwd:FWg9xOKBe51/2IMxWjkqqXYg\\r\\na=ice-options:google-ice\\r\\na=fingerprint:sha-1 46:BC:06:FE:C4:EC:D5:0B:CE:B9:FC:BE:55:3E:65:EB:85:28:26:06\\r\\na=setup:actpass\\r\\na=mid:data\\r\\na=sctpmap:5000 webrtc-datachannel 1024\\r\\n\",\"type\":\"offer\"}\n{\"candidate\":\"candidate:2085243720 1 udp 2122063615 192.168.1.70 59631 typ host generation 0\",\"sdpMLineIndex\":0,\"sdpMid\":\"datae}\n{\"candidate\":\"candidate:852080568 1 tcp 1518083839 192.168.1.70 53788 typ host tcptype passive generation 0\",\"sdpMLineIndex\":0,\"sdpMid\":\"data\"}\n{\"candidate\":\"candidate:2321167004 1 udp 1685855999 107.201.128.213 59631 typ srflx raddr 192.168.1.70 rport 59631 generation 0\",\"sdpMLineIndex\":0,\"sdpMid\":\"data\"}\n\n./natty -out answerer \u003c offerer\n{\"sdp\":\"v=0\\r\\no=- 3470342631269636907 2 IN IP4 127.0.0.1\\r\\ns=-\\r\\nt=0 0\\r\\na=msid-semantic: WMS\\r\\nm=application 9 DTLS/SCTP 5000\\r\\nc=IN IP4 0.0.0.0\\r\\nb=AS:30\\r\\na=ice-ufrag:kAk9nHxBSAnIU5w9\\r\\na=ice-pwd:SgPPuhcyl/qZu/cdZiJTQyJq\\r\\na=fingerprint:sha-1 05:60:24:81:2D:8F:B6:10:C6:EE:20:0E:59:CA:F9:5E:E2:19:42:D5\\r\\na=setup:active\\r\\na=mid:data\\r\\na=sctpmap:5000 webrtc-datachannel 1024\\r\\n\",\"type\":\"answer\"}\n{\"candidate\":\"candidate:2085243720 1 udp 2122063615 192.168.1.70 64492 typ host generation 0\",\"sdpMLineIndex\":0,\"sdpMid\":\"data\"}\n{\"candidate\":\"candidate:852080568 1 tcp 1518083839 192.168.1.70 53790 typ host tcptype passive generation 0\",\"sdpMLineIndex\":0,\"sdpMid\":\"data\"}\n{\"candidate\":\"candidate:2321167004 1 udp 1685855999 107.201.128.213 64492 typ srflx raddr 192.168.1.70 rport 64492 generation 0\",\"sdpMLineIndex\":0,\"sdpMid\":\"data\"}\n```\n\nOn both sides, if the NAT traversal succeeds, after a series of connectivity\nchecks, you should see five tuples emitted on both the offerer and answerer\nside:\n```\noffer -\u003e answer: {\"local\":\"192.168.1.70:65410\",\"proto\":\"udp\",\"remote\":\"192.168.1.70:50746\",\"type\":\"5-tuple\"}\n\nanswer -\u003e offer: {\"local\":\"192.168.1.70:50746\",\"proto\":\"udp\",\"remote\":\"192.168.1.70:65410\",\"type\":\"5-tuple\"}\n```\n\n## Download\n[Windows](https://s3.amazonaws.com/bifurcate/windows/natty.exe) [(PGP sig)](https://s3.amazonaws.com/bifurcate/windows/natty.exe.asc), Linux [32](https://s3.amazonaws.com/bifurcate/linux/i386/natty)/[64](https://s3.amazonaws.com/bifurcate/linux/x86_64/natty), and [OS X](https://s3.amazonaws.com/bifurcate/osx/natty) [(PGP sig)](https://s3.amazonaws.com/bifurcate/osx/natty.asc)\n                                                \nA full demo using natty is available [here](https://github.com/getlantern/go-natty)\nusing the [waddell](https://github.com/getlantern/waddell) signaling server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetlantern%2Fnatty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetlantern%2Fnatty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetlantern%2Fnatty/lists"}