コード例 #1
0
ファイル: client.go プロジェクト: jmcarbo/go-tunnel
// DialTLSReconnecting starts a go-tunnel session managed by a ReconnectingSession object
// over a new connection to addr. The ReconnectingSessions will initially Auth to the server with authExtra
// as well as whenever it reconnects.
func DialReconnecting(network, addr string, authExtra interface{}) (*client.ReconnectingSession, error) {
	dialer := func() (muxado.Session, error) {
		return muxado.Dial(network, addr)
	}

	return client.NewReconnectingSession(dialer, authExtra)
}
コード例 #2
0
ファイル: client.go プロジェクト: jmcarbo/go-tunnel
// Dial starts a go-tunnel session on a new connection to addr
func Dial(network, addr string) (*client.Session, error) {
	mux, err := muxado.Dial(network, addr)
	if err != nil {
		return nil, err
	}
	return client.NewSession(mux), nil
}