事件:'connection'


🌐 Event: 'connection'

当建立新的 TCP 流时,会触发此事件。socket 通常是 net.Socket 类型的对象。通常用户不需要访问此事件。

🌐 This event is emitted when a new TCP stream is established. socket is typically an object of type net.Socket. Usually users will not want to access this event.

此事件也可以由用户显式触发,以向 HTTP 服务器注入连接。在这种情况下,可以传递任何 Duplex 流。

🌐 This event can also be explicitly emitted by users to inject connections into the HTTP server. In that case, any Duplex stream can be passed.