| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3cd2054 commit d9d0d0e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1174,14 +1174,16 @@ added: v8.4.0 | |||
| 1174 | 1174 | * Returns: {undefined} | |
| 1175 | 1175 | ||
| 1176 | 1176 | Initiates a push stream. The callback is invoked with the new `Http2Stream` | |
| 1177 | - instance created for the push stream. | ||
| 1177 | + instance created for the push stream passed as the second argument, or an | ||
| 1178 | + `Error` passed as the first argument. | ||
| 1178 | 1179 | ||
| 1179 | 1180 | ```js | |
| 1180 | 1181 | const http2 = require('http2'); | |
| 1181 | 1182 | const server = http2.createServer(); | |
| 1182 | 1183 | server.on('stream', (stream) => { | |
| 1183 | 1184 | stream.respond({ ':status': 200 }); | |
| 1184 | - stream.pushStream({ ':path': '/' }, (pushStream) => { | ||
| 1185 | + stream.pushStream({ ':path': '/' }, (err, pushStream) => { | ||
| 1186 | + if (err) throw err; | ||
| 1185 | 1187 | pushStream.respond({ ':status': 200 }); | |
| 1186 | 1188 | pushStream.end('some pushed data'); | |
| 1187 | 1189 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments