ExperimentalWarning:http2 模块是实验性的 API

ExperimentalWarning: The http2 module is an experimental API

我在 Node JS 10.9 中使用 HAPI JS 和 HTTP/2。当我使用这个例子启动服务器时,

const fs = require('fs')
const Hapi = require('hapi')
const http2 = require('http2')

const server = new Hapi.Server()
server.connection({
 listener: http2.createServer(),
 host: 'localhost',
 port: 3000
})

server.route({
 method: 'GET',
 path:'/hello',
 handler: function (request, reply) {
   return reply('Hello, World!')
 }
})

server.start((err) => {
 if (err) console.error(err)
 console.log(`Started ${server.connections.length} connections`)
})

我在控制台上收到此警告

(node:16600) ExperimentalWarning: The http2 module is an experimental API.

我在网上找不到相关的解释是否可以在生产模式下使用?在出现此类警告的生产模式下使用 HTTP/2 是否可以?

正如@DoMiNeLa10 指出的那样,实验性警告已在 10.10 中删除:

https://github.com/nodejs/node/pull/22716:

http2:

◦ The http2 module is no longer experimental. #22466

这里很好地讨论了使它成为非实验性所涉及的所有工作:https://github.com/nodejs/node/issues/19453