Skip to content

Instantly share code, notes, and snippets.

@summer4096
Created November 23, 2012 20:40
Show Gist options
  • Save summer4096/4137182 to your computer and use it in GitHub Desktop.
Save summer4096/4137182 to your computer and use it in GitHub Desktop.
var ws = require('websocket.io');
var net = require('net');
var server = ws.listen(3456);
server.on('connection', function(socket){
var google = net.connect({
host: 'google.com',
port: 80
});
google.on('data', function(msg){
socket.write(msg);
});
google.on('close', function(){
socket.end();
});
socket.on('data', function(msg){
google.write(msg);
});
socket.on('close', function(){
google.end();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment