Skip to content

Commit

Permalink
fix: update UQUICClient function name and add UQUICServer function
Browse files Browse the repository at this point in the history
  • Loading branch information
Noooste committed Feb 1, 2025
1 parent 271b402 commit ab0c770
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/tls-resumption/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,4 @@ func runResumptionCheck(helloID tls.ClientHelloID, getCustomSpec func() *tls.Cli
panic(fmt.Sprintf("PSK or session ticket not used for a resumption session, server %s, helloID: %s", serverAddr, helloID.Client))

}
git
10 changes: 9 additions & 1 deletion u_quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ type UQUICConn struct {
sessionTicketSent bool
}

// QUICClient returns a new TLS client side connection using QUICTransport as the
// UQUICClient returns a new TLS client side connection using QUICTransport as the
// underlying transport. The config cannot be nil.
//
// The config's MinVersion must be at least TLS 1.3.
func UQUICClient(config *QUICConfig, clientHelloID ClientHelloID) *UQUICConn {
return newUQUICConn(UClient(nil, config.TLSConfig, clientHelloID))
}

func UQUICServer(config *QUICConfig) *UQUICConn {
return &UQUICConn{
conn: &UConn{
Conn: Server(nil, config.TLSConfig),
},
}
}

func newUQUICConn(uconn *UConn) *UQUICConn {
uconn.quic = &quicState{
signalc: make(chan struct{}),
Expand Down

0 comments on commit ab0c770

Please sign in to comment.