PerformanceResourceTiming.nextHopProtocol - Web APIs 编辑
The nextHopProtocol
read-only property is a string
representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301).
When a proxy is used, if a tunnel connection is established, this property returns the ALPN Protocol ID of the tunneled protocol. Otherwise, this property returns the ALPN Protocol ID of the first hop to the proxy.
Note:
This feature is available in Web Workers.Syntax
resource.nextHopProtocol;
Return value
A string
representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301).
Example
The following example uses the nextHopProtocol
property.
function print_PerformanceEntries() {
// Use getEntriesByType() to just get the "resource" events
var p = performance.getEntriesByType("resource");
for (var i=0; i < p.length; i++) {
print_nextHopProtocol(p[i]);
}
}
function print_nextHopProtocol(perfEntry) {
var value = "nextHopProtocol" in perfEntry;
if (value)
console.log("nextHopProtocol = " + perfEntry.nextHopProtocol);
else
console.log("nextHopProtocol = NOT supported");
}
Specifications
Specification | Status | Comment |
---|---|---|
Resource Timing Level 2 The definition of 'nextHopProtocol' in that specification. | Working Draft | Initial definition. |
Browser compatibility
BCD tables only load in the browser
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论