Documentation ¶
Overview ¶
Package forward is an onion message layer that specifies a single redirection for the remainder of the onion.
This is in contrast to the reverse message, which contains a 3 layer header, needed for when there will be a reply, or just for a compact and indistinguishable 1, 2 or 3 hop relaying that does not leak its position in the route.
Index ¶
- Constants
- func Gen() codec.Codec
- func New(addr *netip.AddrPort) ont.Onion
- type Forward
- func (x *Forward) Account(res *sess.Data, sm *sess.Manager, s *sessions.Data, last bool) (skip bool, sd *sessions.Data)
- func (x *Forward) Decode(s *splice.Splice) (e error)
- func (x *Forward) Encode(s *splice.Splice) error
- func (x *Forward) Handle(s *splice.Splice, p ont.Onion, ng ont.Ngin) (e error)
- func (x *Forward) Len() int
- func (x *Forward) Magic() string
- func (x *Forward) Unwrap() interface{}
- func (x *Forward) Wrap(inner ont.Onion)
Constants ¶
const ( Magic = "forw" Len = magic.Len + 1 + splice.AddrLen )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Forward ¶
Forward is a simple forward of the remainder of the onion to a given address and port. Note that we don't use the key, just the address. Relays can have multiple addresses but for a given message, one of them is chosen.
If a reply is required, the reverse.Reverse is used with a RoutingHeader.
todo: currently clients expect that the different addresses are tunnels to the
same relay. They are considered to be the same physical connection with an extension and are weighted equally. Perhaps they should have bandwidth capacity indications?
func (*Forward) Account ¶
func (x *Forward) Account(res *sess.Data, sm *sess.Manager, s *sessions.Data, last bool) (skip bool, sd *sessions.Data)
Account for the Forward message is straightforward, message size/Mb/RelayRate.
func (*Forward) Magic ¶
Magic is the identifying 4 byte string indicating an Forward message follows.