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 targos committed Mar 14, 2023
1 parent 1b555ae commit 6f18b94
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 @@ -3126,7 +3126,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 6f18b94

Please sign in to comment.