Skip to content
Snippets Groups Projects

Add a new section to rend-spec about managing streams

Merged Nick Mathewson requested to merge nickm/torspec:hs_stream_mgt into main
All threads resolved!
Files
2
+ 29
0
# Managing streams
## Sending BEGIN messages { #send-begin }
In order to open a new stream to an onion service,
the client sends a BEGIN message on an established rendezvous circuit.
When sending a BEGIN message to an onion service,
a client should use an empty string as the target address,
and not set any flags on the begin message.
> For example, to open a connection to `<some_addr>.onion`
> on port 443, a client would send a BEGIN message with
+1
> the address:port string of `":443"`, and a `FLAGS` value of 443.
## Receiving BEGIN messages { #receive-begin }
When a service receives a BEGIN message, it should check its port,
_and ignore all other fields in the begin message_, including its
address and flags.
If a service chooses to reject a BEGIN message, it should typically
destroy the circuit entirely to prevent port scanning,
resource exhaustion, and other undesirable behaviors.
If it does not, it should send back an `END` message with the `DONE` reason,
to avoid leaking any further information.
Loading