Skip to content

Instantly share code, notes, and snippets.

@acacio
Forked from ry/telnet.js
Created December 16, 2010 21:42
Show Gist options
  • Save acacio/744074 to your computer and use it in GitHub Desktop.
Save acacio/744074 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
// requires node v0.3
// telnet.js 80 google.com
net = require('net');
a = process.argv.slice(2);
if (!a.length) {
console.error("telnet.js port [ host=localhost ]");
process.exit(1);
}
s = require('net').Stream();
s.connect.apply(s, a);
s.pipe(process.stdout);
process.openStdin().pipe(s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment