# P2PD
``[Python >= 3.5] [Mac, Win, Nix, BSD, Android]``
[](https://github.com/robertsdotpm/p2pd/blob/main/demo_large.gif)
[Watch demo on Asciinema](https://asciinema.org/a/EhADOwnoPt5KBiQDbwR69bNHS)
Update: Great news everyone! I am over my burn out and feel inspired to hack again. Some things I want to do now:
- Improve docs and make videos so people know more what the project is about. People are still confused I think.
- Improve how interfaces are done in this library -- abstract them out more. This will make the software more robust to failure in the event that interface detection fails.
- More tests for loading nodes -- try to speed that up as people's time is very limited.
- Lets take on the mobile network now and break symmetric NATs. I'm in a rare position now to do that as I'm now behind a CGNAT.
- **Contributors:** You don't even have to write code to help me with this project. I'd love for people who are interested in the project to let me test connectivity from their network. I'm sure we can learn and improve the software.
- I have an idea for something new that could be extremely useful if I can get it to work. You'll have to speculate what it is for nao ;)
**P2PD is a library for doing NAT traversal in Python.** If you're behind a router and want to connect to another computer behind a router the software is for that.
It accomplishes that by using multiple techniques that it tries to get a connection going. I think there was some confusion before with people thinking that this
library was for making P2P networks (like Bitcoins P2P network.) Yes, you --could-- do that, but you would still have to write the bootstrapping code yourself
(I should prob rename ths library at some point tbh, sorry.) The core feature of this library is to make direct connectivity just work regardless of the
relationship between two computers. The computers could even be on the same LAN and the software is still smart enough to facilitate that.
The new release includes a simple domain system that offers open,
authenticated, registration-free, domain names. The feature is free
to use (though some resource limits apply.)
## Installation
On non-windows systems make sure you have gcc and python3-devel installed.
python3 -m pip install p2pd
## Demo
For an interactive demo type this in your terminal.
python3 -m p2pd.demo
## Documentation
https://p2pd.readthedocs.io/
## Features
**P2PD** is a new project aiming to make peer-to-peer networking
simple and ubiquitous. P2PD can be used either as a library or as a service.
As a library P2PD is written in Python 3 using asyncio for everything.
As a service P2PD provides a REST API on http://127.0.0.1:12333/.
The REST API is provided for non-Python languages.
P2PD offers engineers the following features:
- Multiple strategies for establishing peer-to-peer direct connections.
- **Direct connect** = Connect to a reachable node.
- **Reverse connect** = Tell a node to connect to you.
- **TCP hole punching** = Simultaneous TCP connections.
- **TURN** = Use a proxy server as a last resort.
- **Advanced NAT detection.** P2PD can detect 7 different types of NATs and
5 different sub-types for a combined total of **35 unique NAT
configurations.** The result is better NAT bypass.
- **Smart TCP hole punching.** The TCP hole punching algorithm has been
designed to require minimal communication between peers to increase
the chances of success. The algorithm supports a diverse number of
NAT configurations for the best results possible.
- **Port forwarding (IPv4) and pin hole (IPv6.)** Automatically
handles opening ports on the router to increase reachability.
- **Multi-interface.** Focuses on NICs as the starting point
for building services. Introduces 'routes' as a
way to provide visibility into external addresses. You can build
services that support IPv4, IPv6, TCP, and UDP without writing
different code for each of them.
- **Minimal dependencies.** Most of the code in P2PD uses the Python
standard library to improve portability and reduce packaging issues.
- **Built on open protocols.**
**STUN** for address lookups, **MQTT** for signaling messages, and
**TURN** for last resort message relaying.
All of these protocols have public infrastructure.
Raw data
{
"_id": null,
"home_page": "http://github.com/robertsdotpm/p2pd",
"name": "p2pd",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "NAT traversal, TCP hole punching, simultaneous open, UPnP, STUN, TURN, SIP, DHCP, add IP to interface, NATPMP, P2P, Peer-to-peer networking library, python",
"author": "Matthew Roberts",
"author_email": "matthew@roberts.pm",
"download_url": "https://files.pythonhosted.org/packages/cf/82/10a1f90ad8efe76482f0d4abfdf41cb690e021ac3b3ab42e0838dcd3a73b/p2pd-3.1.3.tar.gz",
"platform": null,
"description": "# P2PD\n\n``[Python >= 3.5] [Mac, Win, Nix, BSD, Android]``\n\n[](https://github.com/robertsdotpm/p2pd/blob/main/demo_large.gif)\n\n[Watch demo on Asciinema](https://asciinema.org/a/EhADOwnoPt5KBiQDbwR69bNHS)\n\nUpdate: Great news everyone! I am over my burn out and feel inspired to hack again. Some things I want to do now:\n\n- Improve docs and make videos so people know more what the project is about. People are still confused I think.\n- Improve how interfaces are done in this library -- abstract them out more. This will make the software more robust to failure in the event that interface detection fails.\n- More tests for loading nodes -- try to speed that up as people's time is very limited.\n- Lets take on the mobile network now and break symmetric NATs. I'm in a rare position now to do that as I'm now behind a CGNAT.\n- **Contributors:** You don't even have to write code to help me with this project. I'd love for people who are interested in the project to let me test connectivity from their network. I'm sure we can learn and improve the software.\n- I have an idea for something new that could be extremely useful if I can get it to work. You'll have to speculate what it is for nao ;)\n\n**P2PD is a library for doing NAT traversal in Python.** If you're behind a router and want to connect to another computer behind a router the software is for that.\nIt accomplishes that by using multiple techniques that it tries to get a connection going. I think there was some confusion before with people thinking that this\nlibrary was for making P2P networks (like Bitcoins P2P network.) Yes, you --could-- do that, but you would still have to write the bootstrapping code yourself\n(I should prob rename ths library at some point tbh, sorry.) The core feature of this library is to make direct connectivity just work regardless of the\nrelationship between two computers. The computers could even be on the same LAN and the software is still smart enough to facilitate that.\n\nThe new release includes a simple domain system that offers open,\nauthenticated, registration-free, domain names. The feature is free\nto use (though some resource limits apply.)\n\n## Installation\n\nOn non-windows systems make sure you have gcc and python3-devel installed.\n\n python3 -m pip install p2pd\n\n## Demo\n\nFor an interactive demo type this in your terminal.\n\n python3 -m p2pd.demo\n\n## Documentation\n\nhttps://p2pd.readthedocs.io/\n\n## Features\n\n**P2PD** is a new project aiming to make peer-to-peer networking\nsimple and ubiquitous. P2PD can be used either as a library or as a service.\nAs a library P2PD is written in Python 3 using asyncio for everything.\nAs a service P2PD provides a REST API on http://127.0.0.1:12333/.\nThe REST API is provided for non-Python languages.\n\nP2PD offers engineers the following features:\n\n- Multiple strategies for establishing peer-to-peer direct connections.\n\n - **Direct connect** = Connect to a reachable node.\n - **Reverse connect** = Tell a node to connect to you.\n - **TCP hole punching** = Simultaneous TCP connections.\n - **TURN** = Use a proxy server as a last resort.\n- **Advanced NAT detection.** P2PD can detect 7 different types of NATs and\n 5 different sub-types for a combined total of **35 unique NAT\n configurations.** The result is better NAT bypass.\n- **Smart TCP hole punching.** The TCP hole punching algorithm has been\n designed to require minimal communication between peers to increase\n the chances of success. The algorithm supports a diverse number of\n NAT configurations for the best results possible.\n- **Port forwarding (IPv4) and pin hole (IPv6.)** Automatically\n handles opening ports on the router to increase reachability.\n- **Multi-interface.** Focuses on NICs as the starting point\n for building services. Introduces 'routes' as a\n way to provide visibility into external addresses. You can build\n services that support IPv4, IPv6, TCP, and UDP without writing\n different code for each of them.\n- **Minimal dependencies.** Most of the code in P2PD uses the Python\n standard library to improve portability and reduce packaging issues.\n- **Built on open protocols.**\n **STUN** for address lookups, **MQTT** for signaling messages, and\n **TURN** for last resort message relaying.\n All of these protocols have public infrastructure.\n",
"bugtrack_url": null,
"license": "public domain",
"summary": "Asynchronous P2P networking library and service",
"version": "3.1.3",
"project_urls": {
"Homepage": "http://github.com/robertsdotpm/p2pd"
},
"split_keywords": [
"nat traversal",
" tcp hole punching",
" simultaneous open",
" upnp",
" stun",
" turn",
" sip",
" dhcp",
" add ip to interface",
" natpmp",
" p2p",
" peer-to-peer networking library",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "cf8210a1f90ad8efe76482f0d4abfdf41cb690e021ac3b3ab42e0838dcd3a73b",
"md5": "d265501ffd3d2b57da7dd5748414fa70",
"sha256": "62a54f56e4e74041387e32ef5034a7fc6f9d60d5c5ba3fa678c2fc33c15c32a3"
},
"downloads": -1,
"filename": "p2pd-3.1.3.tar.gz",
"has_sig": false,
"md5_digest": "d265501ffd3d2b57da7dd5748414fa70",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 811681,
"upload_time": "2025-09-04T07:53:05",
"upload_time_iso_8601": "2025-09-04T07:53:05.019356Z",
"url": "https://files.pythonhosted.org/packages/cf/82/10a1f90ad8efe76482f0d4abfdf41cb690e021ac3b3ab42e0838dcd3a73b/p2pd-3.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-04 07:53:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "robertsdotpm",
"github_project": "p2pd",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"circle": true,
"lcname": "p2pd"
}