request.socket


返回一个 Proxy 对象,该对象表现得像一个 net.Socket(或 tls.TLSSocket),但会根据 HTTP/2 逻辑应用 getter、setter 和方法。

【Returns a Proxy object that acts as a net.Socket (or tls.TLSSocket) but applies getters, setters, and methods based on HTTP/2 logic.】

destroyedreadablewritable 属性将从 request.stream 中获取并设置。

destroyemitendononce 方法将被调用在 request.stream 上。

setTimeout 方法将会在 request.stream.session 上被调用。

pausereadresumewrite 会抛出错误,错误代码为 ERR_HTTP2_NO_SOCKET_MANIPULATION。更多信息请参见 Http2Session 和套接字

所有其他交互将直接路由到套接字。使用 TLS 支持时,使用 request.socket.getPeerCertificate() 获取客户端的认证详情。

【All other interactions will be routed directly to the socket. With TLS support, use request.socket.getPeerCertificate() to obtain the client's authentication details.】