Skip to content

Latest commit

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

package main
import (
"crypto/tls""fmt""github.com/tlsproxy/pgproxy"
)
funcmain() {
proxyConfig:=&pgproxy.ProxyConfig{
Src: "0.0.0.0:7777",
Dst: "192.168.1.11:5432",
HandleError: func(errerror) {
fmt.Printf("%+v", err)
},
HandleRead: func(b []byte, state tls.ConnectionState) error {
returnnil
},
HandleWrite: nil,
HandleClientState: func(w tls.ConnectionState) error {
returnnil
},
}
tlsConfig:=&pgproxy.TlsConfig{
ServerCert: "/ca/server.crt",
ServerKey: "/ca/server.key",
CaCert: "/ca/ca.crt",
}
proxy, err:=pgproxy.NewProxy(proxyConfig, tlsConfig)
iferr!=nil {
panic(err)
}
err=proxy.Listen()
iferr!=nil {
panic(err)
}
}

About

Offer TLS encryption terminates for PostgreSQL

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages