Via Syntax
Tags: wire, transport
© R.A.Sol
A via string identifies a transport endpoint.
Grammar
Full form:
scheme+host[:port]
Bare form (auto-negotiate transport):
host[:port]
Hostless form (used in HELLO Transport headers where
host is already known):
scheme[:port]
HELLO transport header value:
via *(SP hint)
Known hints:
flow=session
flow=message
path=<absolute-path>
Unix domain socket:
unix+<absolute-path>
Schemes
| Scheme | Default port | Transport |
|---|---|---|
tcp |
4777 |
TCP plaintext |
quib |
4776 |
QUIB encrypted (036) |
ws |
4778 |
WebSocket |
udp |
4777 |
UDP datagram message flow |
http |
80 |
HTTP POST request |
auto |
4777 |
Auto-negotiate (equivalent to bare form) |
Host
Host is a hostname, IPv4 address, or bracketed IPv6 address.
IPv6 bracket form: [::1] or
[::1]:port.
Port
Port is optional. When omitted, the scheme default applies. Bare
form defaults to 4777.
Hostless Resolution
Hostless forms appear in HELLO Transport headers.
The client fills in the host from its existing connection.
Examples:
tcp— TCP on default port, same hostudp:4777— UDP on port 4777, same hostquib:4776— QUIB on port 4776, same host
HELLO Transport Hints
A Transport HELLO header starts with a via string or
transport endpoint. Any remaining space-separated tokens are hints
about that endpoint.
Known command-flow hints:
flow=session— endpoint runs session command flowflow=message— endpoint runs message command flow
HTTP path hint:
path=<absolute-path>— HTTP request path, default/hppr
path= applies only to HTTP unless another transport
spec defines it. Unknown hints are ignored. Flow hints describe the
command flow reachable at that transport endpoint, not the current
endpoint that produced the HELLO.
Examples:
Transport: tcp:4777 flow=sessionTransport: quib:4776 flow=sessionTransport: ws:4778 flow=sessionTransport: http:4778 flow=message path=/hpprTransport: udp:4777 flow=message
Display Form
The canonical display form is:
scheme+host:portwhen a scheme is sethost:portfor auto-negotiateunix+<path>for Unix sockets
Examples
| Input | Scheme | Host | Port |
|---|---|---|---|
tcp+10.0.0.1 |
tcp | 10.0.0.1 | 4777 |
tcp+10.0.0.1:9000 |
tcp | 10.0.0.1 | 9000 |
quib+1.1.1.1:4776 |
quib | 1.1.1.1 | 4776 |
udp+10.0.0.1 |
udp | 10.0.0.1 | 4777 |
http+example.com:8080 |
http | example.com | 8080 |
ws+example.com |
ws | example.com | 4778 |
auto+example.com |
auto | example.com | 4777 |
example.com |
auto | example.com | 4777 |
example.com:9000 |
auto | example.com | 9000 |
tcp:4777 |
tcp | (from context) | 4777 |
udp |
udp | (from context) | 4777 |
unix+/tmp/hppr.sock |
— | — | — |