summaryrefslogtreecommitdiffstats
path: root/node_modules/node-gyp/test/simple-proxy.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
commit81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch)
tree8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/node-gyp/test/simple-proxy.js
parent1870f3fdf43707a15fda0f609a021f516f45eb63 (diff)
downloadwebsite_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip
rm node_modules
Diffstat (limited to 'node_modules/node-gyp/test/simple-proxy.js')
-rw-r--r--node_modules/node-gyp/test/simple-proxy.js24
1 files changed, 0 insertions, 24 deletions
diff --git a/node_modules/node-gyp/test/simple-proxy.js b/node_modules/node-gyp/test/simple-proxy.js
deleted file mode 100644
index e55330c..0000000
--- a/node_modules/node-gyp/test/simple-proxy.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var http = require('http')
- , https = require('https')
- , server = http.createServer(handler)
- , port = +process.argv[2]
- , prefix = process.argv[3]
- , upstream = process.argv[4]
- , calls = 0
-
-server.listen(port)
-
-function handler (req, res) {
- if (req.url.indexOf(prefix) != 0)
- throw new Error('request url [' + req.url + '] does not start with [' + prefix + ']')
-
- var upstreamUrl = upstream + req.url.substring(prefix.length)
- console.log(req.url + ' -> ' + upstreamUrl)
- https.get(upstreamUrl, function (ures) {
- ures.on('end', function () {
- if (++calls == 2)
- server.close()
- })
- ures.pipe(res)
- })
-}