Created
October 5, 2014 20:39
-
-
Save matejkramny/81584068767594c4e741 to your computer and use it in GitHub Desktop.
Tiny net proxy
This file contains 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
var net = require('net'); | |
net.createServer(function (socket) { | |
socket.on('data', function (chunk) { | |
console.log(chunk.toString('utf8')); | |
}); | |
var d = net.createConnection('/var/run/docker.sock'); | |
d.on('data', function (chunk) { | |
console.log('res ->', chunk.toString('utf8')); | |
}); | |
socket.pipe(d); | |
d.pipe(socket); | |
}).listen(3030); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment