Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
dtls
✓ github.com/pion/dtls/v2
Establishes a DTLS connection using PSK.
package main
import (
"fmt"
"github.com/pion/dtls/v2"
)
func main() {
config := &dtls.Config{
PSK: func(hint []byte) ([]byte, error) {
return []byte("secret"), nil
},
PSKIdentityHint: []byte("client"),
}
conn, err := dtls.Dial("udp", "localhost:4444", config)
if err != nil {
panic(err)
}
defer conn.Close()
fmt.Println("Connected via DTLS")
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
2.2.12latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.