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 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 implicit TLS entirely (eg. when using opportunistic TLS on a server // that does not support implicit TLS). NoTLS bool // The configuration to use when dialing with implicit TLS support. // Setting TLSConfig has no effect if NoTLS is true. // The default 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 various session establishment functions in the main xmpp package should be passed the resulting 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. 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").
func (*Dialer) DialServer ¶ added in v0.22.0
func (d *Dialer) DialServer(ctx context.Context, network string, addr jid.JID, server string) (net.Conn, error)
DialServer behaves exactly the same as Dial, besides that the server it tries to connect to is given as argument instead of using the domainpart of the JID.
Changing the server does not affect the server name expected by the default TLSConfig which remains the addresses domainpart.