I’m betting this is either impossible
or highly browser-dependent.
It’s not entirely obvious to me that
a web server is needed to run a CGI
that is on the local machine. (As,
by analogy, we don’t need to run a
server just to look at local static
HTML files.)
Yet while it seems theoretically
possible that a browser could do this,
I don’t know whether any of them
actually will.
Just to stay somewhat on-topic – I
have downloaded Webrick, I just haven’t
yet understood it.
So, a serverless CGI – possible in
theory and practice, in theory only,
or just not happening?
Well, for starters, I think such a program would need to be able to
provide a full CGI environment, as well as handle both ends of a HTTP
request. Theoretically possible to do via a Web browser, but probably
more practical to run your own server (or even have a Ruby class
handling that job, as in Python’s CGIHTTPServer).
Brian W
···
On Friday, May 23, 2003, at 01:22 PM, Hal E. Fulton wrote:
I’m betting this is either impossible
or highly browser-dependent.
It’s not entirely obvious to me that
a web server is needed to run a CGI
that is on the local machine. (As,
by analogy, we don’t need to run a
server just to look at local static
HTML files.)
Yet while it seems theoretically
possible that a browser could do this,
I don’t know whether any of them
actually will.
Just to stay somewhat on-topic – I
have downloaded Webrick, I just haven’t
yet understood it.
So, a serverless CGI – possible in
theory and practice, in theory only,
or just not happening?
It’s not entirely obvious to me that
a web server is needed to run a CGI
that is on the local machine. (As,
by analogy, we don’t need to run a
server just to look at local static
HTML files.)
So, a serverless CGI – possible in
theory and practice, in theory only,
or just not happening?
Hal
with CGI, the HTTP server simply runs the script, providing it with
environment variables (the global ENV hash in Ruby). the variables (see http://tin.2t.net/scripts/envlist.rb for an example) contain the
requested URL, including all the stuff after the ? in GETs and including
all the sent data in POSTs. the script then operates on this data and
its output is then sent by the server to the browser.
both Perl’s CGI.pm and Ruby’s cgi.rb recognize when they’re not being
run via a server and ask for the information, dumping the output to
stdout. while you can save that output into a file and view it, it’s
definitely more work that just typing a URL.
have you considered running a server locally? Apache needs only a few
configuration changes to be able to run Ruby scripts as CGIs (none if
give them .cgi extensions, IIRC), and it’s free
or perhaps someone would like to create a little Ruby app to answer http
requests,fill out the ENV, and run a script. run minicgi.rb somescript.rb and point a browser at http://localhost/?cgidata=goeshere
(where somescript.rb is the CGI script you want to test)
On my own pet webserver, I find it simpler to bypass the ruby cgi library
entirely, and work directly with mod_ruby:
under mod_ruby, $stdout becomes an apache request object
if defined? Apache
$stdout.content_type = ‘text/html’
$stdout.sync_header = true
$stdout.send_http_header
end
Between that, and ENV[‘HTTP_FOOBAR’], I can run my web scripts from the
command line without having the clunky cgi “insert values” prompt in the
way.
Julian
···
On Sat, 24 May 2003 05:22:24 +0900, Hal E. Fulton wrote:
I’m betting this is either impossible
or highly browser-dependent.
It’s not entirely obvious to me that
a web server is needed to run a CGI
that is on the local machine. (As,
by analogy, we don’t need to run a
server just to look at local static
HTML files.)
Yet while it seems theoretically
possible that a browser could do this,
I don’t know whether any of them
actually will.
Just to stay somewhat on-topic – I
have downloaded Webrick, I just haven’t
yet understood it.
So, a serverless CGI – possible in
theory and practice, in theory only,
or just not happening?
I’m betting this is either impossible or highly browser-dependent.
It’s not entirely obvious to me that a web server is needed to run a CGI
that is on the local machine. (As, by analogy, we don’t need to run a
server just to look at local static HTML files.)
Yet while it seems theoretically possible that a browser could do this, I
don’t know whether any of them actually will.
Just to stay somewhat on-topic – I have downloaded Webrick, I just haven’t
yet understood it.
So, a serverless CGI – possible in theory and practice, in theory only, or
just not happening?
–
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ara.t.howard@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
~ > ruby -e ‘p % ^) .intern’
====================================
So, a serverless CGI – possible in theory and practice, in theory only,
or
just not happening?
[snip example]
Thanks, Ara. Yes, I see that.
But that doesn’t let me interact with
the CGI in my browser.
hmm. fastcgi might be a good bet? it allows socket based (unix or tcp)
communication… but how would the browser communicate or start/kill the
process? a java applet perhaps?
actually, you might be able to do something along the lines of embedding an
applet into an html page, the applet might fire up some web server which could
run, and display the output of a ruby cgi program?
i’m totally grasping here - but it seems like
html → java → ruby
might be a viable path though - since java is about the only means of
‘running’ something in a browser without writing an extension/module. maybe
you could do something like this with javascript? i don’t really know.
basically, you need to run a webserver in your browser, and display the output
of local cgi scripts which are cranking out html pages…
something like that would be very cool actually…
i too have considered that html is about the only cross platform gui…
-a
I’m wanting to put a web interface on
a program (in this case, twenty times
easier than writing a GUI). But I was
trying to avoid running a server.
Hal
PS - What does this line mean?? I don’t
see that it’s syntactically correct.
~ > ruby -e ‘p % ^) .intern’
Cheers,
HF
-a
···
On Sat, 24 May 2003, Hal E. Fulton wrote:
====================================
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ara.t.howard@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
~ > ruby -e ‘p % ^) .intern’
====================================
PS - What does this line mean?? I don’t
see that it’s syntactically correct.
~ > ruby -e ‘p % ^) .intern’
:^)
i stole the ‘)’.intern from hal - love it.
Spaces can work as a string delimiter, too.
See [ruby-talk:70206] and surroundings.
BTW, I still believe spaces are no good as delimiters. For it allows
one to do “perfect” obfuscation.
ruby is so nice to read and this used to bother me, now it think it makes
things interesting - like all the secret things in video games (what the heck
do you call them). besides, we already have a language which does not allow
obfuscation - java
System.out.println …
yuck.
i love
p x
it’s great on my carpal tunnel. ruby has the perfect blend of readability
vs. conciseness IMHO. all other languages swing too far the to one side of
the scale, well most anyhow…
e.g., what is the output of the following? (warning, if you want to run
it be sure you copy it byte per byte
p :A; a = % ; puts “Hello, world!”
p :B; a = % ; puts “Hello, world!”
:A
Hello, world!
:B
or
:A
:B
Hello, world!
:A
:B
Hello, world!
tricky.
-a
···
On Sat, 24 May 2003, Mauricio [iso-8859-1] Fernández wrote:
On Sat, May 24, 2003 at 01:19:58PM +0900, Hal E. Fulton wrote:
–
====================================
Ara Howard
NOAA Forecast Systems Laboratory
Information and Technology Services
Data Systems Group
R/FST 325 Broadway
Boulder, CO 80305-3328
Email: ara.t.howard@fsl.noaa.gov
Phone: 303-497-7238
Fax: 303-497-7259
~ > ruby -e ‘p % ^) .intern’
====================================
On Sun, May 25, 2003 at 05:10:41AM +0900, ahoward wrote:
BTW, I still believe spaces are no good as delimiters. For it allows
one to do “perfect” obfuscation.
ruby is so nice to read and this used to bother me, now it think it makes
things interesting - like all the secret things in video games (what the heck
do you call them).
il Sun, 25 May 2003 06:18:36 +0900, Brian Candler B.Candler@pobox.com ha scritto::
On Sun, May 25, 2003 at 05:10:41AM +0900, ahoward wrote:
BTW, I still believe spaces are no good as delimiters. For it allows
one to do “perfect” obfuscation.
ruby is so nice to read and this used to bother me, now it think it makes
things interesting - like all the secret things in video games (what the heck
do you call them).
ruby is so nice to read and this used to bother me, now it think it makes
things interesting - like all the secret things in video games (what the heck
do you call them).
Easter eggs?
I suppose he’s talking about cheats
That’s not very PC (politically correct).
Since the word “cheats” has negative connotations, hidden goodies are
called “easter eggs.” I mean, who doesn’t love finding easter eggs?
Back to talking Ruby, though, right?
-Kent
···
–
Kent R. Spillner
“They that can give up essential liberty to obtain a little
temporary safety deserve neither liberty nor safety.”
- Benjamin Franklin
ruby is so nice to read and this used to bother me, now it think it
makes
things interesting - like all the secret things in video games (what
the heck
do you call them).
Easter eggs?
I suppose he’s talking about cheats
That’s not very PC (politically correct).
Then I will use it more often.
Since the word “cheats” has negative connotations, hidden goodies are
called “easter eggs.” I mean, who doesn’t love finding easter eggs?
I think the word might be “back doors.” Many/most of
the “Easter eggs” I know of are innocuous things like
pictures/names of the developers, and so on.
Even “Lair of he Squid” on the old HP 200LX palmtop
had a secret key sequence that would display photos
of the development team like portraits on the wall
of the 3D maze.
Back to talking Ruby, though, right?
Right!
Hal
···
----- Original Message -----
From: “Kent R. Spillner” kent@zerosphere.org
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Saturday, May 24, 2003 6:02 PM
Subject: [OT] Was: Re: Naive CGI question