Skip to content

Instantly share code, notes, and snippets.

Erona Eronana

Block or report user

Report or block Eronana

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Eronana
Eronana / reverse_proxy_with_proxy.js
Created Oct 1, 2018
a simple reverse proxy server with http proxy
View reverse_proxy_with_proxy.js
const http = require('http');
const PROXY_PASS = 'http://www.google.com';
const HTTP_PROXY_PORT = 8888;
const HTTP_PROXY_HOST = '127.0.0.1';
const getOptions = (request) => ({
hostname: HTTP_PROXY_HOST,
port: HTTP_PROXY_PORT,
path: PROXY_PASS + request.url,
@Eronana
Eronana / iterator.js
Last active Aug 3, 2017
Implement iterator without generator
View iterator.js
function Iterator (next) {
this[Symbol.iterator] = function () {
let obj = { next };
obj[Symbol.iterator] = function () {
return this;
}
return obj;
};
};
You can’t perform that action at this time.