Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Simple HTTP in under 100 lines

by Corion (Patriarch)
on Nov 13, 2001 at 20:17 UTC ( [id://125069]=note: print w/replies, xml ) Need Help??


in reply to Re: Simple HTTP in under 100 lines
in thread Simple HTTP in under 100 lines

I use PSI::ESP to address the errors :-)

  • Trouble with running the server without -T on the command line - I get this error every time I try to use taint mode : Too late for -T. I don't know about any way around it except specifying -T on the command line.
  • -h dosen't work. - There is no -h option, so it won't work.
  • Connections are not always closed when a child exits. I'm not sure when this happens - my experience showed that IE kept a child alive until either some timeout happened or I closed that IE window (or visited another URL with that window)
  • Sending ^C to the server gives a funny error message - This is a "problem" with HTTP::Daemon which seems to want to call a ^C (instead of GET) method. I don't know how to fix this without patching HTTP::Daemon.
  • .pl files will be downloaded, even though they are executable and only readable by the user running the webserver. - This works as designed. Everything below the webserver root is exported, and as long as the user under which the webserver is run can read the file it will transfer that file. Note that especially no execution of files is possible.

I'm not keen to add any more features to that server as it would transcend both the line count limit and the complexity limit - also, this server is used to stream 200MB files over my meager 128kbit line, so each child lives a very long time.

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://125069]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (7)
As of 2024-04-25 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found