Questions tagged [http-daemon]

HTTP::Daemon is the a Perl module used to write HTTP servers.

HTTP::Daemon is the a simple HTTP 1.1 server for Perl. The Perl 5 version is available in CPAN. There is a Perl 6 version of the same module. The similar structure and methods help migrate web server applications from Perl 5 to 6.

9 questions
4
votes
1 answer

How do I clean up after my Daemon?

I am running a local instance of HTTP::Daemon using a modified version of the looping structure outlined in the documentation. I have made it possible to exit the loop at the user's request, but a subsequent execution of my Perl script gives me the…
fbrereto
  • 35,429
  • 19
  • 126
  • 178
3
votes
1 answer

HTTP::Daemon: How to set a custom value for Server in HTTP-Header?

I am using HTTP::Daemon for a HTTP-server. use strict; use warnings; use HTTP::Daemon; my $d = HTTP::Daemon->new (Listen => 1, LocalPort => 8080, ReuseAddr => 1, Blocking => 0) or die "error daemon: " . $!; while (1) { my $c = $d->accept (); …
chris01
  • 10,921
  • 9
  • 54
  • 93
2
votes
1 answer

HTTP::Daemon forks sub processes that aren't reaped on SIGTERM

Updated: I have a unittest (consider it X). There is a subprocess (Y). Y does not explicitly fork. X forks so it can exec Y. Here is X: warn("Starting Y..."); my $pid; die "failed to fork" unless($pid = fork); unless($pid) { { exec "exec…
Craig
  • 4,268
  • 4
  • 36
  • 53
1
vote
2 answers

HTTP server using perl HTTP::Daemon - only works from the same computer the server is running on

I am going to create a simple HTTP server that I will also create some clients for it. Right now I am testing my simple server created in perl using HTTP::Daemon by a browser. My server code is as follows: use HTTP::Daemon; use HTTP::Status; my $d…
nav
  • 11
  • 3
1
vote
1 answer

Perl simple webserver not handling multiple requests simultaneously

I wrote a simple webserver which should continuously handle simultaneous requests. But, even after detaching the threads it doesn't handle simultaneous requests. Can someone help? Webserver.pl use HTTP::Daemon; use threads; my $webServer; my…
Soumya dutta
  • 79
  • 1
  • 7
1
vote
1 answer

Perl HTTP Daemon Server- Reading POST JSON body

I was using HTTP::Daemon to create a http server for my API. With the help of following example and doc, I was able to create a basic HTTP server. However, my API should accepts JSON as a body in post request to the server. So, I need to read the…
Ritesh Kumar Gupta
  • 5,055
  • 7
  • 45
  • 71
1
vote
1 answer

Stop processing when client has timed out with HTTP::Daemon

Is there a way to have HTTP::Daemon somehow detect when the client has disconnected (for instance because of a timeout) and thereafter kill itself? Right now, this is how I wrote my server: my $response; try { local $SIG{ALRM} = sub { die…
scozy
  • 2,511
  • 17
  • 34
1
vote
1 answer

HTTP::Daemon crashing when I stop the loop

I'm working on an adhoc GUI so that I can easily view a bunch of data from the VMWare Perl SDK without having to setup a bunch of scripts under IIS. The basic idea is to start up the script, and have it fork two processes. One is the HTTP::Daemon…
AndrewBurton
  • 407
  • 7
  • 16
0
votes
1 answer

How to implement HttpDaemon

I am a Java Programmer.I have to implement HttpDaemon.I think it would be written in 'C' or 'Perl' . Kindly help me in what is it and How to implement it.