http2 -> spdy #25
This commit is contained in:
parent
17674f2a32
commit
27ed19832e
14
README.md
14
README.md
|
@ -21,7 +21,7 @@ npm install --save letsencrypt-express
|
||||||
* standalone
|
* standalone
|
||||||
* express
|
* express
|
||||||
* http / https
|
* http / https
|
||||||
* http / http2
|
* http / http2 / spdy
|
||||||
* koa
|
* koa
|
||||||
|
|
||||||
### Setup (same for all examples)
|
### Setup (same for all examples)
|
||||||
|
@ -60,10 +60,6 @@ letsencrypt certonly --standalone \
|
||||||
|
|
||||||
### Standalone
|
### Standalone
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install --save http2
|
|
||||||
```
|
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
lex.onRequest = function (req, res) {
|
lex.onRequest = function (req, res) {
|
||||||
res.end('Hello, World!');
|
res.end('Hello, World!');
|
||||||
|
@ -81,7 +77,7 @@ lex.listen([80], [443, 5001], function () {
|
||||||
## Express
|
## Express
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install --save http2
|
npm install --save spdy
|
||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
@ -106,7 +102,7 @@ Let's say you want to redirect all http to https.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var https = require('http2');
|
var https = require('spdy');
|
||||||
// NOTE: you could use the old https module if for some reason you don't want to support modern browsers
|
// NOTE: you could use the old https module if for some reason you don't want to support modern browsers
|
||||||
|
|
||||||
function redirectHttp() {
|
function redirectHttp() {
|
||||||
|
@ -161,7 +157,7 @@ Note: you don't need to create websockets for the plain ports.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var WebSocketServer = require('ws').Server;
|
var WebSocketServer = require('ws').Server;
|
||||||
var https = require('http2');
|
var https = require('spdy');
|
||||||
var server = https.createServer(lex.httpsOptions, LEX.createAcmeResponder(lex, app));
|
var server = https.createServer(lex.httpsOptions, LEX.createAcmeResponder(lex, app));
|
||||||
var wss = new WebSocketServer({ server: server });
|
var wss = new WebSocketServer({ server: server });
|
||||||
|
|
||||||
|
@ -383,7 +379,7 @@ Here's absolutely every option and function exposed
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var https = require('http2');
|
var https = require('spdy');
|
||||||
var LEX = require('letsencrypt-express');
|
var LEX = require('letsencrypt-express');
|
||||||
var LE = require('letsencrypt');
|
var LE = require('letsencrypt');
|
||||||
var lex;
|
var lex;
|
||||||
|
|
Loading…
Reference in New Issue