Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
bnoordhuis / http-and-https-proxy.js
Created February 8, 2013 16:31
A node.js proxy that accepts HTTP and HTTPS traffic on the same port.
var fs = require('fs');
var net = require('net');
var http = require('http');
var https = require('https');
var httpAddress = '/path/to/http.sock';
var httpsAddress = '/path/to/https.sock';
fs.unlinkSync(httpAddress);
fs.unlinkSync(httpsAddress);