diff options
Diffstat (limited to 'proxy')
| -rw-r--r-- | proxy/index.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/proxy/index.js b/proxy/index.js index 80cd6d4b..d84d3813 100644 --- a/proxy/index.js +++ b/proxy/index.js @@ -37,6 +37,10 @@ server.on('request', function (req, res){ options.hostname = 'secure.api.yoox.biz' options.path = req.url +if (req.method == "DELETE") { + console.log(options.headers) + console.log(req.url) +} req.pause() var connector = https.request(options, function(server_res) { console.log('>> GOT', server_res.statusCode) @@ -58,6 +62,15 @@ server.on('request', function (req, res){ server_res.resume() }) + connector.on('response', function(e){ + console.log(">> RESPONSE") + }) + connector.on('connect', function(e){ + console.log(">> CONNECT") + }) + connector.on('error', function(e){ + console.error(e) + }) if (DEBUG) { req.on('data', function(s){ console.log('>>', s.toString()) }) } @@ -85,7 +98,7 @@ function get_headers (h){ }) hh['Content-Type'] = 'application/json' // h['content-type'] if ('content-length' in h) hh['Content-Length'] = h['content-length'] - if ('connection' in h) hh['Connection'] = h['connection'] + // if ('connection' in h) hh['Connection'] = h['connection'] return hh } |
