Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Homework

Name: Anonymous 2010-02-09 16:16

Write a small HTTP server that upon receiving a GET request, responds with Sussman. Other /prog/ related responses may be added at your discretion.

Name: Anonymous 2010-02-09 16:55

I got bored after leaving too many sockets open

Name: Anonymous 2010-02-09 17:01

U MENA /prog/

Name: Anonymous 2010-02-09 17:23

>>3
Hang yourself.

Name: Anonymous 2010-02-09 17:42

>>4
Listen here, jerkface

Name: Anonymous 2010-02-09 20:07

#!/usr/bin/perl
use IO::Socket;
$s = IO::Socket::INET->new(LocalAddr => 'localhost:7764', Listen => 1);
while ($c = $s->accept()) {
    print $c "HTTP/1.0 200 OK\r\n";
    print $c "Content-type: text/html\r\n\r\n";
    print $c '<html><head></head><body><b>Sussman</b></body></html>';
    close($c);
}

Name: Anonymous 2010-02-09 23:19

>>6
upon receiving a GET request

Name: Anonymous 2010-02-09 23:23

newLISP
suss.lsp
[code]; Start with
;  newlisp suss.lsp -http -d 80
(write-file "suss" "SUSSMAN")
(command-event (fn (s) "GET /suss"))[code]

Name: Anonymous 2010-02-10 0:48


#!/usr/bin/node
require("http").createServer(function (request, response) {
  response.sendHeader(200, {"Content-Type": "text/plain"});
  response.sendBody("Sussman");
  response.finish();
}).listen(8080);

Name: Anonymous 2010-02-10 1:02

>>9
now with GET awareness.

#!/usr/bin/node
var sys = require('sys');
require("http").createServer(function (request, response) {
  if (request.method == "GET") {
    response.sendHeader(200, {"Content-Type": "text/html"});
    response.sendBody("<html><body><b>Sussman</b></body></html>");
  } else {
    response.sendHeader(405, {"Content-Type": "text/plain"});
    response.sendBody("YOU MENA HASKAL?");
  }
  response.finish();
}).listen(80);

Name: Anonymous 2010-02-10 8:57

while nc -lp 80 -c 'head -1|grep GET >/dev/null && echo Sussman || true'; do true; done

Name: Anonymous 2010-02-10 10:06

>>7
My code satisfies that requirement, does it matter if it responds to other request types?

Name: Anonymous 2010-02-10 11:43

>>11
You need to netcat the output.

Name: Anonymous 2010-02-10 11:48

>>13
NETCAT MY ANUS

Name: Anonymous 2010-02-10 17:24

>>9,10

#!/usr/bin/node
What language is this?

Name: Anonymous 2010-02-10 17:42

>>15
Looks like ECMAscript with good libraries.

Name: Anonymous 2010-02-10 17:43

>>15
node

Name: Anonymous 2010-02-11 4:49

The node program accepts TCP/IP and packet radio network connections and
 presents users with an interface that allows them to make gateway connections
 to remote hosts using a variety of amateur radio protocols.

Name: sage 2010-02-11 6:49

>>18
not that node, nodejs - http://nodejs.org/

Name: Anonymous 2010-02-11 6:50

>>19
misplaced my sage -_-;

Name: Anonymous 2010-02-11 9:04

>>19
WHY IS THE TEXT SO DAMN BIG ON THAT PAGE?

Name: Anonymous 2010-02-11 11:09

>>21
idiots like larger text. cf children's books

Name: Anonymous 2011-02-03 2:03

Don't change these.
Name: Email:
Entire Thread Thread List