Update documentation

This commit is contained in:
Joseph Henry
2021-05-25 15:24:28 -07:00
parent 30d2e5f129
commit ede730de1c
4 changed files with 27 additions and 71 deletions

View File

@@ -1,9 +1,5 @@
# Python example
This example demonstrates how to use the ZeroTier socket interface provided by libzt in a Python application. The API is designed to be a drop-in replacement for the Python [Low-level networking interface](https://docs.python.org/3/library/socket.html).
Note: Only `AF_INET` and `AF_INET6` address families are supported.
### Install
```
@@ -12,12 +8,12 @@ pip install libzt
### Run
```
python3 example.py server id-path/bob 0123456789abcdef 9997 8080
python3 example.py client id-path/alice 0123456789abcdef 9996 11.22.33.44 8080
python3 example.py server id-path/bob 0123456789abcdef 8080
python3 example.py client id-path/alice 0123456789abcdef ip.ip.ip.ip 8080
```
*Where `9996` and `9997` are arbitrary ports that you allow ZeroTier to use for encrypted UDP traffic, port `8080` is an arbitrary port used by the client/server socket code, and `11.22.33.44` should be whatever IP address the network assigns your node.*
## Links
### Implementation Details
- See [src/bindings/python](../../src/bindings/python)
- Getting Started: [docs.zerotier.com/sockets](https://docs.zerotier.com/sockets/tutorial.html)
- Source [src/bindings/python](../../src/bindings/python)
- Design inspired by: [Python Low-level networking interface](https://docs.python.org/3/library/socket.html)