Skip to content

Commit ee2092f

Browse files
Peter Martonhekike
Peter Marton
authored andcommitted
feat(http2): add HTTP/2 support
1 parent 0e19c0e commit ee2092f

15 files changed

+2206
-1511
lines changed

docs/_api/request.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Otherwise the given type is matched by an exact match, and then subtypes.
5555

5656
**Examples**
5757

58-
_You may pass the subtype such as html which is then converted internally to
59-
text/html using the mime lookup table:_
58+
_You may pass the subtype such as html which is then converted internally
59+
to text/html using the mime lookup table:_
6060

6161
```javascript
6262
// Accept: text/html
@@ -95,8 +95,8 @@ Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
9595

9696
### getContentType
9797

98-
Returns the value of the content-type header. If a content-type is not set,
99-
this will return a default value of `application/octet-stream`
98+
Returns the value of the content-type header. If a content-type is not
99+
set, this will return a default value of `application/octet-stream`
100100

101101
Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)**
102102

@@ -300,8 +300,8 @@ Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
300300
Start the timer for a request handler.
301301
By default, restify uses calls this automatically for all handlers
302302
registered in your handler chain.
303-
However, this can be called manually for nested functions inside the handler
304-
chain to record timing information.
303+
However, this can be called manually for nested functions inside the
304+
handler chain to record timing information.
305305

306306
**Parameters**
307307

@@ -310,8 +310,8 @@ chain to record timing information.
310310
**Examples**
311311

312312
_You must explicitly invoke
313-
endHandlerTimer() after invoking this function. Otherwise timing information
314-
will be inaccurate._
313+
endHandlerTimer() after invoking this function. Otherwise timing
314+
information will be inaccurate._
315315

316316
```javascript
317317
server.get('/', function fooHandler(req, res, next) {

docs/_api/response.md

+16-13
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ formatter based on the `content-type` header.
154154

155155
_You can use send() to wrap up all the usual writeHead(), write(), end()
156156
calls on the HTTP API of node.
157-
You can pass send either a `code` and `body`, or just a body. body can be an
158-
`Object`, a `Buffer`, or an `Error`.
159-
When you call `send()`, restify figures out how to format the response based
160-
on the `content-type`._
157+
You can pass send either a `code` and `body`, or just a body. body can be
158+
an `Object`, a `Buffer`, or an `Error`.
159+
When you call `send()`, restify figures out how to format the response
160+
based on the `content-type`._
161161

162162
```javascript
163163
res.send({hello: 'world'});
@@ -169,8 +169,8 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer
169169

170170
### sendRaw
171171

172-
Like `res.send()`, but skips formatting. This can be useful when the payload
173-
has already been preformatted.
172+
Like `res.send()`, but skips formatting. This can be useful when the
173+
payload has already been preformatted.
174174
Sends the response object. pass through to internal `__send` that skips
175175
formatters entirely and sends the content as is.
176176

@@ -189,7 +189,8 @@ Uses `header()` underneath the hood, enabling multi-value headers.
189189

190190
**Parameters**
191191

192-
- `name` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** name of the header or `Object` of headers
192+
- `name` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** name of the header or
193+
`Object` of headers
193194
- `val` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** value of the header
194195

195196
**Examples**
@@ -236,13 +237,15 @@ Redirect is sugar method for redirecting.
236237
- `options.hostname` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** redirect location's hostname
237238
- `options.pathname` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** redirect location's pathname
238239
- `options.port` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** redirect location's port number
239-
- `options.query` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** redirect location's query string parameters
240-
- `options.overrideQuery` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** if true, `options.query` stomps over
241-
any existing query parameters on current URL.
242-
by default, will merge the two.
240+
- `options.query` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** redirect location's query string
241+
parameters
242+
- `options.overrideQuery` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** if true, `options.query`
243+
stomps over any existing query
244+
parameters on current URL.
245+
by default, will merge the two.
243246
- `options.permanent` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** if true, sets 301. defaults to 302.
244-
- `next` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** mandatory, to complete the response and trigger audit
245-
logger.
247+
- `next` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** mandatory, to complete the response and trigger
248+
audit logger.
246249

247250
**Examples**
248251

docs/_api/server.md

+3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ Creates a new Server.
116116
response header, default is `restify`. Pass empty string to unset the header. (optional, default `false`)
117117
- `options.spdy` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Any options accepted by
118118
[node-spdy](https://github.com/indutny/node-spdy).
119+
- `options.http2` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Any options accepted by
120+
[http2.createSecureServer]\(<https://nodejs.org/api/http2.html>
121+
\#http2_http2_createsecureserver_options_onrequesthandler).
119122
- `options.handleUpgrades` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Hook the `upgrade` event
120123
from the node HTTP server, pushing `Connection: Upgrade` requests through the
121124
regular request handling chain. (optional, default `false`)

0 commit comments

Comments
 (0)