1 ADDR=SOCKADDR(AF_INET, "127.0.0.1", 12345)
2 S=SOCKET(AF_INET, SOCK_STREAM, 0)
3 BIND(S,ADDR)
4 LISTEN(S)
5 MEMORY M, 256
6 .LOOP
7 SOCK=ACCEPT(S)
8 FP=FDOPEN(SOCK, "r")
9 REQ=FGETS(FP)
10 PRINTF("%s",REQ)
11 (LEFT(REQ,3)!="GET"): GOTO DISCON
12 SIZE=MWRITE(M,,,"<html><body>It works!</body></html>\n")
13 SEND(SOCK,M,,SIZE)
14 .DISCON
15 FCLOSE(FP)
16 GOTO LOOP
