Documentation ¶
Index ¶
- Constants
- Variables
- func AddRelayTransport(ctx context.Context, h host.Host, upgrader *tptu.Upgrader, opts ...RelayOpt) error
- type Conn
- type NetAddr
- type Relay
- func (r *Relay) CanHop(ctx context.Context, id peer.ID) (bool, error)
- func (r *Relay) Dial(ctx context.Context, a ma.Multiaddr) (*Conn, error)
- func (r *Relay) DialPeer(ctx context.Context, relay pstore.PeerInfo, dest pstore.PeerInfo) (*Conn, error)
- func (r *Relay) Listener() *RelayListener
- func (r *Relay) Matches(addr ma.Multiaddr) bool
- func (r *Relay) Notifiee() inet.Notifiee
- func (r *Relay) Transport() *RelayTransport
- type RelayError
- type RelayListener
- type RelayNotifiee
- func (n *RelayNotifiee) ClosedStream(net inet.Network, s inet.Stream)
- func (n *RelayNotifiee) Connected(s inet.Network, c inet.Conn)
- func (n *RelayNotifiee) Disconnected(s inet.Network, c inet.Conn)
- func (n *RelayNotifiee) Listen(net inet.Network, a ma.Multiaddr)
- func (n *RelayNotifiee) ListenClose(net inet.Network, a ma.Multiaddr)
- func (n *RelayNotifiee) OpenedStream(net inet.Network, s inet.Stream)
- func (n *RelayNotifiee) Relay() *Relay
- type RelayOpt
- type RelayTransport
- func (t *RelayTransport) CanDial(raddr ma.Multiaddr) bool
- func (d *RelayTransport) Dial(ctx context.Context, a ma.Multiaddr, p peer.ID) (tpt.Conn, error)
- func (t *RelayTransport) Listen(laddr ma.Multiaddr) (tpt.Listener, error)
- func (t *RelayTransport) Protocols() []int
- func (t *RelayTransport) Proxy() bool
- func (t *RelayTransport) Relay() *Relay
Constants ¶
View Source
const P_CIRCUIT = 290
View Source
const ProtoID = "/libp2p/circuit/relay/0.1.0"
Variables ¶
View Source
var ( OptActive = RelayOpt(0) OptHop = RelayOpt(1) )
View Source
var HopConnectTimeout = 10 * time.Second
View Source
var Protocol = ma.Protocol{ Code: P_CIRCUIT, Size: 0, Name: "p2p-circuit", VCode: ma.CodeToVarint(P_CIRCUIT), }
View Source
var RelayAcceptTimeout = time.Minute
Functions ¶
Types ¶
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
func (*Relay) Listener ¶
func (r *Relay) Listener() *RelayListener
func (*Relay) Transport ¶
func (r *Relay) Transport() *RelayTransport
type RelayError ¶
type RelayError struct {
Code pb.CircuitRelay_Status
}
func (RelayError) Error ¶
func (e RelayError) Error() string
type RelayListener ¶
type RelayListener Relay
func (*RelayListener) Addr ¶
func (l *RelayListener) Addr() net.Addr
func (*RelayListener) Close ¶
func (l *RelayListener) Close() error
func (*RelayListener) Multiaddr ¶
func (l *RelayListener) Multiaddr() ma.Multiaddr
func (*RelayListener) Relay ¶
func (l *RelayListener) Relay() *Relay
type RelayNotifiee ¶ added in v1.1.0
type RelayNotifiee Relay
func (*RelayNotifiee) ClosedStream ¶ added in v1.1.0
func (n *RelayNotifiee) ClosedStream(net inet.Network, s inet.Stream)
func (*RelayNotifiee) Connected ¶ added in v1.1.0
func (n *RelayNotifiee) Connected(s inet.Network, c inet.Conn)
func (*RelayNotifiee) Disconnected ¶ added in v1.1.0
func (n *RelayNotifiee) Disconnected(s inet.Network, c inet.Conn)
func (*RelayNotifiee) Listen ¶ added in v1.1.0
func (n *RelayNotifiee) Listen(net inet.Network, a ma.Multiaddr)
func (*RelayNotifiee) ListenClose ¶ added in v1.1.0
func (n *RelayNotifiee) ListenClose(net inet.Network, a ma.Multiaddr)
func (*RelayNotifiee) OpenedStream ¶ added in v1.1.0
func (n *RelayNotifiee) OpenedStream(net inet.Network, s inet.Stream)
func (*RelayNotifiee) Relay ¶ added in v1.1.0
func (n *RelayNotifiee) Relay() *Relay
type RelayTransport ¶
type RelayTransport Relay
func (*RelayTransport) Protocols ¶
func (t *RelayTransport) Protocols() []int
func (*RelayTransport) Proxy ¶
func (t *RelayTransport) Proxy() bool
func (*RelayTransport) Relay ¶
func (t *RelayTransport) Relay() *Relay
Source Files ¶
Click to show internal directories.
Click to hide internal directories.