事件:'connection'
【Event: 'connection'】
socket<stream.Duplex>
当建立新的 TCP 流时会触发此事件,在 TLS 握手开始之前。socket 通常是 net.Socket 类型的对象,但不会接收到事件,这一点不同于从 net.Server 'connection' 事件创建的 socket。通常用户不会想要访问此事件。
【This event is emitted when a new TCP stream is established, before the TLS
handshake begins. socket is typically an object of type net.Socket but
will not receive events unlike the socket created from the net.Server
'connection' event. Usually users will not want to access this event.】
此事件也可以由用户显式触发,以向 TLS 服务器注入连接。在这种情况下,任何 Duplex 流都可以被传递。
【This event can also be explicitly emitted by users to inject connections
into the TLS server. In that case, any Duplex stream can be passed.】