Documentation ¶
Overview ¶
Package dial contains methods and types for dialing XMPP connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dialer ¶
type Dialer struct { net.Dialer // NoLookup stops the dialer from looking up SRV or TXT records for the given // domain. It also prevents fetching of the host metadata file. // Instead, it will try to connect to the domain directly. NoLookup bool // S2S causes the server to attempt to dial a server-to-server connection. S2S bool // Disable TLS entirely (eg. when using StartTLS on a server that does not // support implicit TLS). NoTLS bool // Attempt to create a TLS connection by first looking up SRV records (unless // NoLookup is set) and then attempting to use the domains A or AAAA record. // The nil value is interpreted as a tls.Config with the expected host set to // that of the connection addresses domain part. TLSConfig *tls.Config }
A Dialer contains options for connecting to an XMPP address. After a connection is established the Dial method does not attempt to create an XMPP session on the connection.
The zero value for each field is equivalent to dialing without that option. Dialing with the zero value of Dialer is equivalent to calling the Client function.
func (*Dialer) Dial ¶
Dial discovers and connects to the address on the named network. It will attempt to look up SRV records for the JIDs domainpart or connect to the domainpart directly if dialing the SRV records fails or is disabled.
If the context expires before the connection is complete, an error is returned. Once successfully connected, any expiration of the context will not affect the connection.
Network may be any of the network types supported by net.Dial, but you most likely want to use one of the tcp connection types ("tcp", "tcp4", or "tcp6").