tlsreuse

package module
v0.0.0-...-142a552 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: GPL-3.0 Imports: 4 Imported by: 1

README

go-tlsreuse

以 go-reuse 延伸對 TLS 進行支援,背後機制原理與 go-reuse 和 tls 相同,用法也大同小異。

Examples

// listen on the same port. oh yeah.
crt, err := tls.LoadX509KeyPair("key.crt", "cert.key")
if err != nil {
  panic(err)
}
tlsConfig := &tls.Config{}
tlsConfig.Certificates = []tls.Certificate{crt}
tlsConfig.Time = time.Now
tlsConfig.Rand = rand.Reader


l1, _ := tlsreuse.Listen("tcp", "127.0.0.1:1234", tlsConfig)
l2, _ := tlsreuse.Listen("tcp", "127.0.0.1:1234", tlsConfig)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(network, address string, config *tls.Config) (net.Listener, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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