Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

return proxy-agent header

  • Loading branch information...
commit bbfe1e85921fa32dbd854c9c6cece7b6f3c65281 1 parent d328d50
@igrigorik authored
Showing with 12 additions and 5 deletions.
  1. +1 −0  bin/spdyproxy
  2. +11 −5 lib/server.js
View
1  bin/spdyproxy
@@ -48,6 +48,7 @@ var path = require('path')
}
}).argv;
+opts.version = version;
opts.key = fs.readFileSync(path.resolve(opts.key));
opts.cert = fs.readFileSync(path.resolve(opts.cert));
if (opts.ca) opts.ca = fs.readFileSync(path.resolve(opts.ca));
View
16 lib/server.js
@@ -39,7 +39,7 @@ var SPDYProxy = function(options) {
var rreq = http.request(requestOptions, function(rres) {
delete rres.headers['transfer-encoding'];
- rres.headers['x-spdy-proxy'] = 'v1.0.0';
+ rres.headers['proxy-agent'] = 'SPDY Proxy ' + options.version;
// write out headers to handle redirects
res.writeHead(rres.statusCode, '', rres.headers);
@@ -58,10 +58,16 @@ var SPDYProxy = function(options) {
function handleSecure(req, socket) {
var dest = req.headers.host.split(':');
var tunnel = net.createConnection(dest[1] || 443, dest[0], function() {
- synReply(socket, 200, 'Connection established', {'Connection': 'keep-alive'}, function() {
- tunnel.pipe(socket);
- socket.pipe(tunnel);
- });
+ synReply(socket, 200, 'Connection established',
+ {
+ 'Connection': 'keep-alive',
+ 'Proxy-Agent': 'SPDY Proxy ' + options.version
+ },
+ function() {
+ tunnel.pipe(socket);
+ socket.pipe(tunnel);
+ }
+ );
});
tunnel.setNoDelay(true);
Please sign in to comment.
Something went wrong with that request. Please try again.