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:

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:

HTTP path hint:

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:

Display Form

The canonical display form is:

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