Skip to content

Instantly share code, notes, and snippets.

View koba04's full-sized avatar

Toru Kobayashi koba04

View GitHub Profile
@koba04
koba04 / server.js
Last active April 20, 2020 09:37 — forked from shisama/proxy_server.js
Node.js Proxy Server with Basic Auth Sample
const http = require("http");
const { parse } = require("basic-auth");
const { PROXY_USERNAME, PROXY_PASSWORD } = process.env;
const PROXY_PORT = process.env.PROXY_PORT || 8000;
const check = (credentials) => {
console.log(credentials);
return (
credentials &&
credentials.name === PROXY_USERNAME &&
describe "App.request", ->
beforeEach ->
sinon.stub(App, "request").yieldsTo('done', {res: "ok"})
afterEach ->
App.request.restore()
it "res should be 'ok'", (done) ->
App.request(