summaryrefslogtreecommitdiff
path: root/proxy/index.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-11 13:42:41 -0500
committerJules Laplace <jules@okfoc.us>2015-11-11 13:42:41 -0500
commit94fccaf2454d92eaee41b66fa4e8e11908f6729d (patch)
treee6ba95a17be0d43c6ce8b35e222067c9d2864c8f /proxy/index.js
parent9d30013e953e570552cd86dbb2795ec56b8d1035 (diff)
log headers in debug mode
Diffstat (limited to 'proxy/index.js')
-rw-r--r--proxy/index.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/proxy/index.js b/proxy/index.js
index d84d3813..d30b135b 100644
--- a/proxy/index.js
+++ b/proxy/index.js
@@ -15,6 +15,10 @@ var server = http.createServer().listen(PORT, function(){
server.on('request', function (req, res){
+ if (DEBUG) {
+ console.log("\n\n___________________________")
+ }
+
if ( req.method == 'GET' && ! req.url.match(/API/) ) {
// public...
return stream(req, res)
@@ -37,10 +41,11 @@ 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)
-}
+ if (DEBUG) {
+ console.log(options.headers)
+ console.log(req.url)
+ }
+
req.pause()
var connector = https.request(options, function(server_res) {
console.log('>> GOT', server_res.statusCode)