42 lines
761 B
Markdown
42 lines
761 B
Markdown
|
## peerlink
|
||
|
|
||
|
# get peerlink
|
||
|
|
||
|
git clone https://git.0x2620.org/peerlink.git
|
||
|
|
||
|
# install dependencies
|
||
|
|
||
|
pip3 install -r requirements.txt
|
||
|
|
||
|
# start peerlink
|
||
|
|
||
|
python3 bin/peerlink
|
||
|
|
||
|
# register your application
|
||
|
|
||
|
register application
|
||
|
POST http://[::1]:8842/add
|
||
|
{
|
||
|
"name": "yourappname",
|
||
|
"url": "http://[::1]:YOURPORT/remote/"
|
||
|
}
|
||
|
|
||
|
now peers can make requetss to
|
||
|
|
||
|
GET|POST http://[::1]:8842/<peer id>/PATH
|
||
|
|
||
|
that get proxied and end up on <peer id> at
|
||
|
|
||
|
GET|POST http://[::1]:YOURPORT/remote/PATH
|
||
|
|
||
|
requests have a From: header to indicate the
|
||
|
remote peer id making the request
|
||
|
|
||
|
# local peer discovery
|
||
|
|
||
|
peerlink discovers peers in the local network,
|
||
|
|
||
|
GET http://[::1]:8842/info
|
||
|
|
||
|
contains info on currently visible peers
|