Concepts
Stay organized with collections
Save and categorize content based on your preferences.
The Outline SDK is built upon some basic concepts, defined as interoperable
interfaces that allow for composition and easy reuse.
Connections
Connections enable communication between two endpoints over an abstract
transport. There are two types of connections:
transport.StreamConn
: stream-based connection,
like TCP and the SOCK_STREAM
Posix socket type.
transport.PacketConn
: datagram-based connection,
like UDP and the SOCK_DGRAM
Posix socket type.
We use "Packet" instead of "Datagram" because that is the convention in the
Go standard library.
Connections can be wrapped to create nested connections over a new transport.
For example, a StreamConn
could be over TCP, over TLS over TCP, over HTTP over
TLS over TCP, over QUIC, among other options.
Dialers
Dialers enable the creation of connections given a host:port address while
encapsulating the underlying transport or proxy protocol.
The StreamDialer
and PacketDialer
types create StreamConn
and PacketConn
connections, respectively, given an address. Dialers can also be nested.
For example, a TLS Stream Dialer can use a TCP dialer to create a StreamConn
backed by a TCP connection, then create a TLS StreamConn
backed by the TCP
StreamConn
. A SOCKS5-over-TLS Dialer could use the TLS Dialer to create the
TLS StreamConn
to the proxy before doing the SOCKS5 connection to the target
address.
Resolvers
Resolvers (dns.Resolver
) enable the answering of DNS questions while
encapsulating the underlying algorithm or protocol.
Resolvers are primarily used to map domain names to IP addresses.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-23 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-23 UTC."],[],[],null,["# Concepts\n\nThe Outline SDK is built upon some basic concepts, defined as interoperable\ninterfaces that allow for composition and easy reuse.\n\nConnections\n-----------\n\nConnections enable communication between two endpoints over an abstract\ntransport. There are two types of connections:\n\n- `transport.StreamConn`: stream-based connection, like TCP and the `SOCK_STREAM` Posix socket type.\n- `transport.PacketConn`: datagram-based connection, like UDP and the `SOCK_DGRAM` Posix socket type. We use \"Packet\" instead of \"Datagram\" because that is the convention in the Go standard library.\n\nConnections can be wrapped to create nested connections over a new transport.\nFor example, a `StreamConn` could be over TCP, over TLS over TCP, over HTTP over\nTLS over TCP, over QUIC, among other options.\n\nDialers\n-------\n\nDialers enable the creation of connections given a host:port address while\nencapsulating the underlying transport or proxy protocol.\nThe `StreamDialer` and `PacketDialer` types create `StreamConn` and `PacketConn`\nconnections, respectively, given an address. Dialers can also be nested.\nFor example, a TLS Stream Dialer can use a TCP dialer to create a `StreamConn`\nbacked by a TCP connection, then create a TLS `StreamConn` backed by the TCP\n`StreamConn`. A SOCKS5-over-TLS Dialer could use the TLS Dialer to create the\nTLS `StreamConn` to the proxy before doing the SOCKS5 connection to the target\naddress.\n\nResolvers\n---------\n\nResolvers (`dns.Resolver`) enable the answering of DNS questions while\nencapsulating the underlying algorithm or protocol.\nResolvers are primarily used to map domain names to IP addresses."]]