Created
February 16, 2017 10:47
-
-
Save mooyoul/4fd09a4c3cba95f848b2b4b47e958c0c to your computer and use it in GitHub Desktop.
http-proxy.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const http = require('http'); | |
const request = require('request'); | |
const server = http.createServer((req, res) => { | |
request({ | |
method: 'GET', | |
url: 'http://www.naver.com' | |
}).on('error', (e) => { | |
console.error(e); | |
}).pipe(res); | |
}); | |
server.listen(9000, () => { | |
console.log('server listening on port 9000...'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment