Skip to content

Instantly share code, notes, and snippets.

@keevitaja
Last active June 26, 2016 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keevitaja/5f35241de225f609c0ecf5ad66276f43 to your computer and use it in GitHub Desktop.
Save keevitaja/5f35241de225f609c0ecf5ad66276f43 to your computer and use it in GitHub Desktop.
"use strict";
const net = require('net');
// const REMOTE_ADDR = 198.178.123.109;
// const REMOTE_PORT = 6555;
const REMOTE_ADDR = 'aardmud.org';
const REMOTE_PORT = 4000;
let server = net.createServer((serverSocket)=> {
let clientSocket = net.createConnection(REMOTE_PORT, REMOTE_ADDR, ()=> {
clientSocket.on('data', (clientChunk)=> {
serverSocket.write(clientChunk);
});
})
serverSocket.on('data', (serverChunk)=> {
clientSocket.write(serverChunk);
});
});
server.listen(3000);
console.log('listening 3000 ...');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment