Skip to content

Instantly share code, notes, and snippets.

@mooyoul
Created February 16, 2017 10:47
Show Gist options
  • Save mooyoul/4fd09a4c3cba95f848b2b4b47e958c0c to your computer and use it in GitHub Desktop.
Save mooyoul/4fd09a4c3cba95f848b2b4b47e958c0c to your computer and use it in GitHub Desktop.
http-proxy.js
'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