Documentation
¶
Overview ¶
Package client implements the Hush protocol client. Supports both QUIC (hush://) and TCP (tcps://) transports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Hush protocol client.
func Dial ¶
Dial creates a new Hush client and establishes a session. addr may be "host:port" or "hush://host:port" (QUIC) or "tcps://host:port" (TCP).
By default uses QUIC transport. Use DialTCP or WithTransport(TransportTCP) for TCP.
func DialTCP ¶
func DialTCP(ctx context.Context, addr string, key *session.APIKey, opts ...Option) (*Client, error)
DialTCP creates a client over TLS-over-TCP (useful behind Cloudflare).
client, err := client.DialTCP(ctx, "api.myserver.com:8443", key)
type Option ¶
type Option func(*Client)
Option configures the client.
func WithTLSConfig ¶
WithTLSConfig sets a custom TLS config.
func WithTransport ¶
func WithTransport(mode TransportMode) Option
WithTransport sets the transport mode (QUIC or TCP).
type TransportMode ¶
type TransportMode int
TransportMode selects the underlying transport.
const ( // TransportQUIC uses QUIC over UDP (default). Fast, multiplexed. TransportQUIC TransportMode = iota // TransportTCP uses TLS over TCP. Compatible with Cloudflare. TransportTCP )
Click to show internal directories.
Click to hide internal directories.