1. RE: embedded eu scrupting in a eu program?
gertie at visionsix.com wrote:
> On 28 Feb 2003, at 22:10, mjaksen at subdimension.com wrote:
>
> >
> > I am interested in using euphoria as the embedded scripting language
> > of a webserver to be written in euphoria. We already have Peter Blue's
> > basic webserver posted in "recent contribs".
>
> As far as i know, no one has been able to get a cgi script running on a
> linux
> box but Robert. I've done it on win95.
>
I had no problems setting up Eu and running scripts on a Linux server.
Couple of different ones.
> > how do you run a script
> > embedded in the web page without starting a new instance of the
> > interpreter?
>
> The bigger problem would be how the browser will run the script. You can
> put
> anything you want in the webpage.
>
I'm assuming you are talking about server-side scripting like PHP? In
that case, the browser has nothing to do with it -- it is served normal
HTML, just dynamically generated by the script at the time of the
request. And you probably *would* want a second instance of the
interpreter to run the scripts. Forget that the server is written in
Euphoria -- if it was Apache you'd be starting up an instance of the
interpreter to run a script, right?
2. RE: embedded eu scrupting in a eu program?
Andy --
Exactly, just like PHP but without the 1.5 MB in dll's.
I'm talking about doing this from a Windows machine, obviously in Linux
the infrastructure is there and I would be using PHP/Apache or (eeew)
PERL.
I'm more interested in doing this as a sort of P2P project. EY
client/server would be prety small (I hope -- some of those include
files do get pretty big) and infinitely configurable. Peter Blue's
webserver has means to call an external language (or a second instance
of EU) or the "EGI" thing, but yeah I really want to embed the thing in
the htm like PHP. Seems cleaner. Any ideas? Also useful to "script
enable" a EU application. Also good for wrapping fish and lining
birdcages.
PS- anyone know the overhead to running a EU instance? Worth it to run
multiple servers (diff ports) in seperate processes or mulitask them
through the same exw?
PPS - wrote a "web browser" in VB some 6 years ago. This was before all
the really neat freeware browsers and I needed an anonymous multi-media
browser for a PR project. Kinda sucked but it did work and suitable
impressed the (not so smart) client. Point is: why would you want to do
this unless you wanted to add weird searching or crypto tuff -- in which
case I would set up a local proxy server to mediate between standard
browser (ob1.exe ?) and custom server. Written in EU anyone?
Thanks
Mark
3. RE: embedded eu scrupting in a eu program?
mjaksen at subdimension.com wrote:
> Andy --
>
> Exactly, just like PHP but without the 1.5 MB in dll's.
> I'm talking about doing this from a Windows machine, obviously in Linux
> the infrastructure is there and I would be using PHP/Apache or (eeew)
> PERL.
>
Not to put you off Euphoria, but setting up Apache / PHP / MySQL in
Windows is not hard. (Look for "PHP Triad" -- installs them altogether
ready to go.) I've got it on my home machine and use it once it a while
to serve things up to private parties I might be working with. One
thing I should mention is that the second you put on webserver on your
home machine (I'm assuming you've got broadband) people will start
trying to hack into it and exploit known vulnerabilities. This is for
people doing port scans of the broadband IP's looking for such servers
(I look in my Apache log when it is running, and there is such an
attempt every 10 minutes or so). So set up all the proper security and
firewalls right away. If you're only going to allow a few select people
in, then set up it up so it blocks everyone at the top level without a
password.
> I'm more interested in doing this as a sort of P2P project. EY
> client/server would be prety small (I hope -- some of those include
> files do get pretty big) and infinitely configurable. Peter Blue's
> webserver has means to call an external language (or a second instance
> of EU) or the "EGI" thing, but yeah I really want to embed the thing in
> the htm like PHP. Seems cleaner. Any ideas? Also useful to "script
> enable" a EU application. Also good for wrapping fish and lining
> birdcages.
>
I can't think of an easy way to embed Euphoria in an HTML page like with
PHP. Euphoria would be more like Perl -- the whole thing is a script.
You'd just have to use puts() to output the HTML. It would be easy to
write a function like the PHP include() that reads in a file and echos
it to the browser...
-- Andy
4. RE: embedded eu scrupting in a eu program?
Andy --
> Not to put you off Euphoria, but setting up Apache / PHP / MySQL in
> Windows is not hard. (Look for "PHP Triad" -- installs them altogether
> ready to go.) I've got it on my home machine and use it once it a while
> to serve things up to private parties I might be working with. One
> thing I should mention is that the second you put on webserver on your
> home machine (I'm assuming you've got broadband) people will start
> trying to hack into it and exploit known vulnerabilities.
I already have Apache/PHP/MySQL installed on my Windows machine. My
interest is for using on other peoples' (clients, etc) machines when I
am on-site, en route, travelling, etc. Also, I tried to get my lawyer
wife to start up the webserver in my absence so I could access some
source code I left behind (doh!). I literally had to walk her through
the procces of downloading Badblue and installing it over the telephone
-- long distance.
I'm envisioning a simple, tiny, instant server infrastructure. Something
secure that fits on a diskette -- maybe includes some sort of limited
Windows telnet to root through my file system and set up a P2P/web/mail
server.
Already got the freeware ZoneAlarm up and running on my computer...
thanks for your concern.
>
> I can't think of an easy way to embed Euphoria in an HTML page like with
>
> PHP. Euphoria would be more like Perl -- the whole thing is a script.
> You'd just have to use puts() to output the HTML. It would be easy to
> write a function like the PHP include() that reads in a file and echos
> it to the browser...
which makes it like icky PERL.. an overly complicated approach to what
should be a very simple need to make dynamic websites. Web pages should
be basically web content with some neccesary code embedded -- not heaps
of web content escaped to make it fit into puts() statements.
Well, I'll keep trying.
PS- I hereby found and appoint myself president of SPOTI, the "Society
for the Proliferation Of Tiny Includes". Every see an installation of
PERL or Python. Like a megabyte of include files. Who would install such
a monster?
PPS- By my count 3 typos in my earlier msg. Didn't realize anyone was
keeping score.
Thanks
Mark
5. RE: embedded eu scrupting in a eu program?
> Imagine being able to:
>
> <b>Calculate and print the value in italic:</b>
> <[eu]
> integer i
> i = 2
> i += 2
> printf(1, "<i>i = %d</i><br>\n", i)
> [eu]>
> <b>Done!</b>
I know! Cool! Now imagine using 75KB EU as both the script engine AND
the web/telnet/pop server!
Fits on a floppy. Flexible. Peerless Perr to Peer.
I hope.
Mike