Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add params for ClientHttp2Session:altsvc #20598

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,23 +664,23 @@ added: v8.4.0
added: v9.4.0
-->

* `alt`: {string}
* `origin`: {string}
* `streamId`: {number}
* `alt` {string}
* `origin` {string}
* `stream` {number}

The `'altsvc'` event is emitted whenever an `ALTSVC` frame is received by
the client. The event is emitted with the `ALTSVC` value, origin, and stream
ID. If no `origin` is provided in the `ALTSVC` frame, `origin` will
the client. The event is emitted with the `ALTSVC` value, origin, and stream.
If no `origin` is provided in the `ALTSVC` frame, `origin` will
be an empty string.

```js
const http2 = require('http2');
const client = http2.connect('https://example.org');

client.on('altsvc', (alt, origin, streamId) => {
client.on('altsvc', (alt, origin, stream) => {
Copy link
Member

@lpinca lpinca May 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know there is a type annotation by I think streamId makes it explicit that's an id and not a stream.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, if you say so, I'd change it back.

console.log(alt);
console.log(origin);
console.log(streamId);
console.log(stream);
});
```

Expand Down