Homework
1
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.
2
Name:
Anonymous
2010-02-09 16:55
I got bored after leaving too many sockets open
3
Name:
Anonymous
2010-02-09 17:01
U MENA /prog/
4
Name:
Anonymous
2010-02-09 17:23
5
Name:
Anonymous
2010-02-09 17:42
>>4
Listen here, jerkface
6
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);
}
7
Name:
Anonymous
2010-02-09 23:19
>>6
upon receiving a GET request
8
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]
9
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);
10
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);
11
Name:
Anonymous
2010-02-10 8:57
while nc -lp 80 -c 'head -1|grep GET >/dev/null && echo Sussman || true'; do true; done
12
Name:
Anonymous
2010-02-10 10:06
>>7
My code satisfies that requirement, does it matter if it responds to other request types?
13
Name:
Anonymous
2010-02-10 11:43
>>11
You need to netcat the output.
14
Name:
Anonymous
2010-02-10 11:48
15
Name:
Anonymous
2010-02-10 17:24
>>9,10
#!/usr/bin/node
What language is this?
16
Name:
Anonymous
2010-02-10 17:42
>>15
Looks like ECMAscript with good libraries.
17
Name:
Anonymous
2010-02-10 17:43
18
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.
19
Name:
sage
2010-02-11 6:49
>>18
not
that node, nodejs -
http://nodejs.org/
20
Name:
Anonymous
2010-02-11 6:50
>>19
misplaced my sage -_-;
21
Name:
Anonymous
2010-02-11 9:04
>>19
WHY IS THE TEXT SO DAMN BIG ON THAT PAGE?
22
Name:
Anonymous
2010-02-11 11:09
>>21
idiots like larger text. cf children's books
24
Name:
Anonymous
2011-02-03 2:03