From 1f616eb2c30109c53c06efe419374a86ab97298a Mon Sep 17 00:00:00 2001 From: Szymon Marczak <36894700+szmarczak@users.noreply.github.com> Date: Thu, 28 Jan 2021 00:48:54 +0100 Subject: [PATCH] Mention the `servername` option Fixes #1 --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 86008ff..4fe0b4e 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,15 @@ Returns an object with an `alpnProtocol` property. The `socket` property may be ```js const result = await resolveALPN({ host: 'nghttp2.org', - ALPNProtocols: ['h2', 'http/1.1'] + ALPNProtocols: ['h2', 'http/1.1'], + servername: 'nghttp2.org' }); console.log(result); // {alpnProtocol: 'h2'} ``` +**Note:** While the `servername` option is not required in this case, many other servers do. It's best practice to set it anyway. + #### options Same as [TLS options](https://nodejs.org/api/tls.html#tls_tls_connect_options_callback).