[PLUG] Small script webapps

Heath Morrison heath at doublemarked.com
Sun Dec 13 22:16:55 UTC 2009


Your FIFO idea is interesting, but it doesn't simulate the interactive
nature of a real CGI environment, it just simulates a file. A CGI
environment is interactive and can accept information from the user
and respond to it.

The original poster isn't actually looking for a simulation...they
just want a lightweight HTTP server. An example that comes to mind is
Sinatra, which is an extremely lightweight web framework for Ruby,

  http://www.sinatrarb.com/

If you view that URL you can see in about 15 seconds how you use it.
There is probably a language neutral web server that does things with
similar ease. Maybe somebody can suggest something.

Another temptation may be to rig the browser to simulate the server
component itself, perhaps using some extension or plugin. This would
be bad, as it has a huge potential for scary security threats.

-Heath

On Sun, Dec 13, 2009 at 11:54 PM, Wil Cooley <wcooley at nakedape.cc> wrote:
> On 12/12/2009 02:21 PM, Keith Lofstrom wrote:
>>
>> Which leads to a question:  is there an easy way to run some subset of
>> webscripts locally on a machine, without the complexities of apache?
>>
>> Ideally, it would consist of some programs on the machine that
>> respond to html requests on special ports by running small scripts
>> in /usr/local/web (for example), wrapping those scripts with enough
>> html stuff to talk to the browser.  The browser might have a plugin
>> so that when it sees a request for a naked word "URL" it tries the
>> program hanging on the local port before it looks on the rest of
>> the web.
>>
>> As an example, I could type "bacon" into firefox, and it would go
>> to port 8088 (say) and ask the program watching the port to look
>> for /usr/local/web/bacon, wrap it as needed, and run it.  If there
>> is no /usr/local/web/bacon or ~/web/bacon, firefox does its usual
>> thing with barewords, which in my setup is do a google search for
>> the word bacon.
>>
>
> Not exactly what you describe, but Lynx has a "simulated CGI" mode.
> Doesn't help much since you cannot get much more out of a Lynx session
> than you can with standard I/O or dialog/whiptail/zenity, but at least
> it demonstrates that the idea isn't so far out.
>
> I guess depending on what you really need, you could have scripts
> writing to a named FIFO and have Fx read that; it would be one-way
> generated content only, but I can imagine uses for it.
>
> It works too; I just tried it with:
>
> $ mkfifo /tmp/Test
> $ while (:); do date > /tmp/Test; done
>
> Now I look at 'file:///tmp/Test' in Fx and see the date, reload to see
> it updated, etc.
>
> You could also do something with a local HTTP proxy, I think.
>
> Wil
>
>
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
>



More information about the PLUG mailing list