Skip to content

Commit

Permalink
doc: fix port of destination server is not defined in http2
Browse files Browse the repository at this point in the history
`port` variable is used, but it's not defined in client code.
So need to specify destination server(not proxy)'s port(8000)
in client code.

Refs: https://github.com/nodejs/node/blob/main/doc/api/http2.md#supporting-the-connect-method
PR-URL: #46940
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
  • Loading branch information
deokjinkim authored and danielleadams committed Apr 11, 2023
1 parent ad06168 commit 17a25f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3112,7 +3112,7 @@ const client = http2.connect('http://localhost:8001');
// for CONNECT requests or an error will be thrown.
const req = client.request({
':method': 'CONNECT',
':authority': `localhost:${port}`,
':authority': 'localhost:8000',
});

req.on('response', (headers) => {
Expand Down

0 comments on commit 17a25f1

Please sign in to comment.