【发布时间】:2017-01-29 07:53:38
【问题描述】:
使用以下代码:
var req = http2.request({
hostname: 'api.push.apple.com',
protocol: 'https:',
port: 443,
method: 'POST',
path: '/3/device/' + deviceToken,
agent: new http2.Agent({log: logger}),
headers: {
'apns-topic': 'web.com.example'
},
cert: cert,
key: key,
}, function(res) {
res.pipe(process.stdout);
});
req.write(JSON.stringify(post));
req.end();
如何发送PING 帧来检查我与node-http2 模块的连接状况?
提前致谢。
【问题讨论】:
-
Ping 是完全不同的协议,与 HTTP/2 无关
-
@FabianBettag -
ping frame是一个不同于ping程序的 http2 事物。见http2.github.io/http2-spec/#PING -
那我很抱歉。
-
你使用哪个节点版本? v8.x.x 中有一个函数
ping
标签: node.js http connection ping http2