Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

Commit

Permalink
docs: adding circuit relay docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov committed Oct 23, 2017
1 parent ed97a84 commit b358901
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ const secio = require('libp2p-secio')
swarm.connection.crypto(secio.tag, secio.encrypt)
```

#### `swarm.connection.enableCircuitRelay(options)`

Enable circuit relaying.

- `options`
- enabled - activates relay dialing and listening functionality
- hop - an object with two properties
- enabled - enables circuit relaying
- active - is it an active or passive relay (default false)

### `swarm.dial(peer, protocol, callback)`

dial uses the best transport (whatever works first, in the future we can have some criteria), and jump starts the connection until the point where we have to negotiate the protocol. If a muxer is available, then drop the muxer onto that connection. Good to warm up connections or to check for connectivity. If we have already a muxer for that peerInfo, then do nothing.
Expand Down

0 comments on commit b358901

Please sign in to comment.