mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[doc] Minor formatting updates to README.md
This commit is contained in:
parent
29e6e748f7
commit
67539519fa
22
README.md
22
README.md
@ -224,15 +224,13 @@ Sometimes you want to listen to an event on a proxy. For example, you may want t
|
||||
var httpProxy = require('http-proxy');
|
||||
|
||||
var server = httpProxy.createServer(function (req, res, proxy) {
|
||||
var buffer = httpProxy.buffer(req);
|
||||
|
||||
var buffer = httpProxy.buffer(req);
|
||||
|
||||
proxy.proxyRequest(req, res, {
|
||||
host: '127.0.0.1',
|
||||
port: 9000,
|
||||
buffer: buffer
|
||||
});
|
||||
|
||||
proxy.proxyRequest(req, res, {
|
||||
host: '127.0.0.1',
|
||||
port: 9000,
|
||||
buffer: buffer
|
||||
});
|
||||
});
|
||||
|
||||
server.proxy.on('end', function() {
|
||||
@ -307,11 +305,11 @@ var https = require('https'),
|
||||
//
|
||||
// generic function to load the credentials context from disk
|
||||
//
|
||||
function getCredentialsContext(cer){
|
||||
function getCredentialsContext (cer) {
|
||||
return crypto.createCredentials({
|
||||
key: fs.readFileSync(path.join(__dirname, 'certs', cer + '.key')),
|
||||
cert: fs.readFileSync(path.join(__dirname, 'certs', cer + '.crt'))
|
||||
}).context;
|
||||
key: fs.readFileSync(path.join(__dirname, 'certs', cer + '.key')),
|
||||
cert: fs.readFileSync(path.join(__dirname, 'certs', cer + '.crt'))
|
||||
}).context;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user