server.addContext(hostname, context)


server.addContext() 方法会添加一个安全上下文,如果客户端请求的 SNI 名称与提供的 hostname(或通配符)匹配,将使用该上下文。

【The server.addContext() method adds a secure context that will be used if the client request's SNI name matches the supplied hostname (or wildcard).】

当存在多个匹配的上下文时,会使用最近添加的那个。

【When there are multiple matching contexts, the most recently added one is used.】