Skip to content

Instantly share code, notes, and snippets.

@ry
Created November 18, 2010 05:45

Revisions

  1. ry created this gist Nov 18, 2010.
    13 changes: 13 additions & 0 deletions telnet.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/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);