allyc has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I am currently writing a web application which has to function across 3 web servers, each of which will perform different functions.

There will be 1 Main NT server and then 2 Unix servers.

At present, if a function on one of the Unix servers is required I am just loading the page directly from the required server within either a Popup window or an IFrame.

This however causes problems interacting with the window because of the Javascript origin security policy.

I am now looking into using something like LWP or IO::Socket::INET to pull the output from the Unix servers back to the master one, so I will have no problems with the same origin policy and also the the applications security can be improved.

The Problem is that many of the scripts that I am running on the unix servers turn buffering off so that the status of the process can be displayed to the end user. Examples of these processes are a FTP Client that shows the progress of the Transfer.

Is there any way to call the script from the Unix servers within my main application using LWP or IO::Socket without having the output buffered so the status is still reported correctly?

Which is the best method to use if it is possible and are there any pointers that might help me?

Many Thanks in advance.

Alistair

  • Comment on Using LWP or IO::Socket::INET without Buffering

Replies are listed 'Best First'.
Re: Using LWP or IO::Socket::INET without Buffering
by saintbrie (Scribe) on Apr 21, 2004 at 11:24 UTC
    If you are using Apache on your NT machine, you should look into setting up mod_proxy. It'll probably end up saving you a lot of grief. If you are not, there must be some equivalent piece of software for IIS (or whatever you are using).

      Yes I am using Apache 2 on the NT Machine and I have just looked at the mod_proxy and it works however it seems to buffer the output.

      I have looked at the Apache site and there is a directive that I can use to stop buffering, but there is a bug that will not allow a buffer smaller than 8192 bytes using the ProxyIOBufferSize 8192 apache 2 directive.

      I know its not a Perl question, but if any one has experience of this module I would appreciate it.

      Otherwise I will have to get my Perl Script to output about 8000 bytes of information after each print to that it will display properly.

      Many thanks again!! The monks never let me down!