RunQUIC attaches the router to a http.Server and starts listening and serving QUIC requests. It is a shortcut for http3.ListenAndServeQUIC(addr, certFile, keyFile, router) Note: this method will block the calling goroutine indefinitely unless an error happens.
(addr, certFile, keyFile string)
| 628 | // It is a shortcut for http3.ListenAndServeQUIC(addr, certFile, keyFile, router) |
| 629 | // Note: this method will block the calling goroutine indefinitely unless an error happens. |
| 630 | func (engine *Engine) RunQUIC(addr, certFile, keyFile string) (err error) { |
| 631 | debugPrint("Listening and serving QUIC on %s\n", addr) |
| 632 | defer func() { debugPrintError(err) }() |
| 633 | |
| 634 | if engine.isUnsafeTrustedProxies() { |
| 635 | debugPrint("[WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\n" + |
| 636 | "Please check https://github.com/gin-gonic/gin/blob/master/docs/doc.md#dont-trust-all-proxies for details.") |
| 637 | } |
| 638 | |
| 639 | err = http3.ListenAndServeQUIC(addr, certFile, keyFile, engine.Handler()) |
| 640 | return |
| 641 | } |
| 642 | |
| 643 | // RunListener attaches the router to a http.Server and starts listening and serving HTTP requests |
| 644 | // through the specified net.Listener |