@@ -36,6 +36,8 @@ type configuration struct {
3636 Logger logger
3737 ErrorLogger logger
3838 HTTPServer httpServer
39+ Protocols * http.Protocols
40+ HTTP2 * http.HTTP2Config
3941}
4042
4143func New (options ... option ) ListenCloser {
@@ -73,6 +75,12 @@ func (singleton) IgnoredErrors(value ...error) option {
7375func (singleton ) HTTPServer (value httpServer ) option {
7476 return func (this * configuration ) { this .HTTPServer = value }
7577}
78+ func (singleton ) Protocols (value * http.Protocols ) option {
79+ return func (this * configuration ) { this .Protocols = value }
80+ }
81+ func (singleton ) HTTP2 (value * http.HTTP2Config ) option {
82+ return func (this * configuration ) { this .HTTP2 = value }
83+ }
7684func (singleton ) MaxRequestHeaderSize (value int ) option {
7785 return func (this * configuration ) { this .MaxRequestHeaderSize = value }
7886}
@@ -133,6 +141,8 @@ func (singleton) apply(options ...option) option {
133141 ReadHeaderTimeout : this .ReadRequestHeaderTimeout ,
134142 WriteTimeout : this .WriteResponseTimeout ,
135143 IdleTimeout : this .IdleConnectionTimeout ,
144+ Protocols : this .Protocols ,
145+ HTTP2 : this .HTTP2 ,
136146 BaseContext : func (net.Listener ) context.Context { return this .Context },
137147 ErrorLog : newServerLogger (this .ErrorLogger ),
138148 }
@@ -151,6 +161,8 @@ func (singleton) defaults(options ...option) []option {
151161 return append ([]option {
152162 Options .ListenAddress (":http" ),
153163 Options .TLSConfig (nil ),
164+ Options .Protocols (nil ),
165+ Options .HTTP2 (nil ),
154166 Options .MaxRequestHeaderSize (1024 * 2 ),
155167 Options .ReadRequestTimeout (time .Second * 5 ),
156168 Options .ReadRequestHeaderTimeout (time .Second ),
0 commit comments