netextra

package
v0.0.0-...-0ace8a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2017 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Direct = &net.Dialer{}

Direct is a Dialer which just uses the net package directly.

Functions

This section is empty.

Types

type Dialer

type Dialer interface {
	Dial(network, addr string) (c net.Conn, err error)
}

Dialer is the same as the Dialer interface from "golang.org/x/net/proxy". the Dial method has the same semantics as net.Dial from the standard library.

We duplicate this here, as well as the "Direct" dialer, rather than pull in an extra dependency from which we use so little.

type TLSDialer

type TLSDialer struct {
	Base Dialer
}

A TLSDialer speaks TLS over the `Base` Dialer, verifying the hostname it is passed.

func (*TLSDialer) Dial

func (d *TLSDialer) Dial(network, addr string) (net.Conn, error)

Dial invokes d.Base.Dial, and then establishes a TLS session over the resulting connection. If any error occurs during the handshake, the connection will be closed and the error will be returned to the caller.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL