Repository URL to install this package:
|
Version:
1.0.0-1 ▾
|
vending-octopus-trigger-dep
/
usr
/
local
/
lib
/
vending
/
octopus
/
trigger
/
node_modules
/
resolve-alpn
|
|---|
| .. |
| index.js |
| package.json |
| LICENSE |
| .editorconfig |
| README.md |
| .travis.yml |
| test.js |
resolve-alpnReturns an object with an alpnProtocol property. The socket property may be also present.
const result = await resolveALPN({ host: 'nghttp2.org', ALPNProtocols: ['h2', 'http/1.1'] }); console.log(result); // {alpnProtocol: 'h2'}
Same as TLS options.
By default, the socket gets destroyed and the promise resolves.
If you set this to true, it will return the socket in a socket property.
const result = await resolveALPN({ host: 'nghttp2.org', ALPNProtocols: ['h2', 'http/1.1'], resolveSocket: true }); console.log(result); // {alpnProtocol: 'h2', socket: tls.TLSSocket} // Remember to close the socket! result.socket.end();
MIT