Skip to content

Commit

Permalink
Mention the servername option
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
szmarczak committed Jan 27, 2021
1 parent 2d2a0f5 commit 1f616eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -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).
Expand Down

0 comments on commit 1f616eb

Please sign in to comment.