doc: fix port of destination server is not defined in http2

`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: https://github.com/nodejs/node/pull/46940
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
Deokjin Kim authored and Michaël Zasso committed 2023-03-14 07:54:06 +01:00
1 parent 1b555ae72d
commit 6f18b947be
1 file changed
+1 -1
+1 -1
View File
@@ -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) => {