1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-11 07:03:32 +08:00

swarm + net: add explicit listen addresses

This commit is contained in:
Juan Batiz-Benet
2014-11-05 03:59:18 -08:00
parent f0f202ed08
commit 0135e3ebbe
8 changed files with 138 additions and 23 deletions

View File

@ -6,6 +6,8 @@ import (
srv "github.com/jbenet/go-ipfs/net/service"
peer "github.com/jbenet/go-ipfs/peer"
ctxc "github.com/jbenet/go-ipfs/util/ctxcloser"
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
)
// Network is the interface IPFS uses for connecting to the world.
@ -37,6 +39,14 @@ type Network interface {
// SendMessage sends given Message out
SendMessage(msg.NetMessage) error
// ListenAddresses returns a list of addresses at which this network listens.
ListenAddresses() []ma.Multiaddr
// InterfaceListenAddresses returns a list of addresses at which this network
// listens. It expands "any interface" addresses (/ip4/0.0.0.0, /ip6/::) to
// use the known local interfaces.
InterfaceListenAddresses() ([]ma.Multiaddr, error)
}
// Sender interface for network services.