Add a new protocol
Co-authored-by: Gérald Croës <gerald@containo.us>
This commit is contained in:
parent
0ca2149408
commit
4a68d29ce2
231 changed files with 6895 additions and 4395 deletions
17
tcp/tls.go
Normal file
17
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