This repository has been archived by the owner on Mar 31, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Argv handling.
- Loading branch information
n1try
committed
Nov 14, 2016
1 parent
89236c3
commit e656308
Showing
9 changed files
with
59 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
.vscode | ||
.vscode | ||
certs |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const pushMiddleware = require('./../index')({ baseUrl: 'http://localhost:8080' }) | ||
, app = require('express')() | ||
, http = require('spdy') | ||
, fs = require('fs'); | ||
|
||
app.use('/static', pushMiddleware.proxy); | ||
app.use('/static', pushMiddleware.push); | ||
app.get('/', (req, res) => { | ||
res.send('It works!'); | ||
}); | ||
|
||
const spdyOpts = { | ||
key: fs.readFileSync(__dirname + '/certs/dev-key.pem'), | ||
cert: fs.readFileSync(__dirname + '/certs/dev-cert.pem'), | ||
spdy: { | ||
protocols: ['h2', 'spdy/3.1', 'http/1.1'], | ||
plain: false, | ||
'x-forwarded-for': true, | ||
} | ||
}; | ||
|
||
http.createServer(spdyOpts, app).listen(8081); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters