我已經做了一個小型服務器嘗試在節點上的http2,但我不知道推機制是否工作。我的風格負荷在http2但是,這並不意味着,推動工作爲目的...快速http 2服務器推送
const port = 3000
const spdy = require('spdy')
const express = require('express')
const path = require('path')
const fs = require('fs')
const app = express()
app.get('*', (req, res) => {
res.set('Link', '</css/styles.css>; rel=preload; as=style');
res.sendFile(__dirname + '/index.html')
})
const options = {
key: fs.readFileSync(__dirname + '/keys/server.key'),
cert: fs.readFileSync(__dirname + '/keys/server.crt')
}
spdy.createServer(options, app).listen(3000);
在devtools,發起者說:「其他」。
嘗試使用[這](https://chrome.google.com/webstore/detail/http2-and-spdy-indicator/mpbpobfflnpcgagjijhmgnchggcjblin)在鉻 藍色表示SPDY,紅色表示HTTP1.1,綠色代表QUIC – alpheus
@alpheus http2正在工作,我可以在devtool網絡協議列中看到。但是沒有提到推動。在你的擴展中也沒有提到它(它對我來說是藍色的btw)。 – Ced