Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Moroka8 committed 2026-04-09 00:15:22 +07:00
commit 1d2fea2040
10 files changed
+1528 -136

No files matched your search

+12 -10
View File
@@ -2,7 +2,6 @@ package main
import (
"context"
"crypto/tls"
"flag"
"fmt"
"io"
@@ -51,16 +50,19 @@ func main() {
panic(genErr)
}
// Prepare the configuration of the DTLS connection
config := &dtls.Config{
Certificates: []tls.Certificate{certificate},
ExtendedMasterSecret: dtls.RequireExtendedMasterSecret,
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256},
ConnectionIDGenerator: dtls.RandomCIDGenerator(8),
}
//
// Everything below is the pion-DTLS API! Thanks for using it ❤️.
//
// Listen for DTLS connections
listener, err := dtls.Listen("udp", addr, config)
// Connect to a DTLS server
listener, err := dtls.ListenWithOptions(
"udp",
addr,
dtls.WithCertificates(certificate),
dtls.WithExtendedMasterSecret(dtls.RequireExtendedMasterSecret),
dtls.WithCipherSuites(dtls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256),
dtls.WithConnectionIDGenerator(dtls.RandomCIDGenerator(8)),
)
if err != nil {
panic(err)
}