> A test suite and interface you can use to implement a connection. A connection is understood as something that offers mechanism for writing and reading data, back pressure, half and full duplex streams. This module and test suite were heavily inspired by abstract-blob-store and interface-stream-muxer.
The primary goal of module is to enable developers to pick, swap or upgrade their connection without loosing the same API expectations and mechanisms such as back pressure and the hability to half close a connection.
Publishing a test suite as a module lets multiple modules all ensure compatibility since they use the same test suite.
The API is presented with both Node.js and Go primitives, however, there is not actual limitations for it to be extended for any other language, pushing forward the cross compatibility and interop through diferent stacks.
Include this badge in your readme if you make a module that is compatible with the interface-connection API. You can validate this by running the tests.
### Get the Observed Addresses of the peer in the other end
-`JavaScript` - `conn.getObservedAddrs(callback)`
This method retrieves the observed addresses we get from the underlying transport, if any.
`callback` should follow the follow `function (err, multiaddrs) {}`, where `multiaddrs` is an array of [multiaddr](https://github.com/jbenet/multiaddr).
### Get the PeerInfo
-`JavaScript` - `conn.getPeerInfo(callback)`
This method retrieves the a Peer Info object that contains information about the peer that this conn connects to.
`callback` should follow the `function (err, peerInfo) {}` signature, where peerInfo is a object of type [Peer Info](https://github.com/diasdavid/js-peer-info)
### Set the PeerInfo
-`JavaScript` - `conn.setPeerInfo(peerInfo)`
j
This method stores a reference to the peerInfo Object that contains information about the peer that this conn connects to.
`peerInfo` is a object of type [Peer Info](https://github.com/diasdavid/js-peer-info)
---
notes:
- should follow the remaining Duplex stream operations