DEP0202:HTTP/2 服务器的 Http1IncomingMessage 和 Http1ServerResponse 选项
🌐 DEP0202: Http1IncomingMessage and Http1ServerResponse options of HTTP/2 servers
类型:仅文档
🌐 Type: Documentation-only
[http2.createServer()][http2.createServer()] 和 [http2.createSecureServer()][http2.createSecureServer()] 的 Http1IncomingMessage 和 Http1ServerResponse 选项已被弃用。请改用 http1Options.IncomingMessage 和 http1Options.ServerResponse。
🌐 The Http1IncomingMessage and Http1ServerResponse options of
http2.createServer() and http2.createSecureServer() are
deprecated. Use http1Options.IncomingMessage and
http1Options.ServerResponse instead.
// Deprecated
const server = http2.createSecureServer({
allowHTTP1: true,
Http1IncomingMessage: MyIncomingMessage,
Http1ServerResponse: MyServerResponse,
}); // Use this instead
const server = http2.createSecureServer({
allowHTTP1: true,
http1Options: {
IncomingMessage: MyIncomingMessage,
ServerResponse: MyServerResponse,
},
});