Skip to content

Commit

Permalink
fix: add option in example coode
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiYueTing committed Aug 17, 2023
1 parent 5c848e6 commit 8ce0c70
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions examples/options/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,16 @@ func main() {
m.Handle("/b", mux.HandlerFunc(handleB))

tcpOpts := []tcpServer.Option{}
tcpOpts = append(tcpOpts, options.WithMux(m), options.WithContext(context.Background()))
tcpOpts = append(tcpOpts,
options.WithMux(m),
options.WithContext(context.Background()))

dtlsOpts := []dtlsServer.Option{}
dtlsOpts = append(dtlsOpts, options.WithMux(m), options.WithContext(context.Background()))
dtlsOpts = append(dtlsOpts,
options.WithMux(m),
options.WithContext(context.Background()),
options.WithOnNewConn(handleOnNewConn),
)

go func() {
// serve a tcp server on :5686
Expand Down

0 comments on commit 8ce0c70

Please sign in to comment.