Move code to pkg
This commit is contained in:
parent
bd4c822670
commit
f1b085fa36
465 changed files with 656 additions and 680 deletions
17
pkg/tcp/tls.go
Normal file
17
pkg/tcp/tls.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package tcp
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
)
|
||||
|
||||
// TLSHandler handles TLS connections
|
||||
type TLSHandler struct {
|
||||
Next Handler
|
||||
Config *tls.Config
|
||||
}
|
||||
|
||||
// ServeTCP terminates the TLS connection
|
||||
func (t *TLSHandler) ServeTCP(conn net.Conn) {
|
||||
t.Next.ServeTCP(tls.Server(conn, t.Config))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue