Jump to content

the DtTvB's AutoIt Web Server


the DtTvB
 Share

Recommended Posts

Hello, I made a really simple GUI for this web server.

Thanks!

but i didnt see it yet, i cant promise that it will all get merged into the trunk ;)

small fix. This is for the last version that spyrorocks? uploaded with timeout support.

There is an issue were after it processes the au3 script it does not close the socket and so it appears as though the server hangs. The fix is to remove the continueloop after you output the data.

Here is a fixed version that I have also added debuging to(right now only for the preprocessing) and it also includes reduce memory function. Reduce mem cut's it's memory usage in about half. Also there seems to be a slow leak someplace as the memory usage goes up and up the more pages that are viewed and does not ever come back down without the reducemem function.

Thank you, but this was already fixed in the svn version :lmao:

i'll have a sharp lookout for a memory leak.

if there realy is one then EmptyWorkingSet wont fix it :evil:

or its a windows feature :mad:

I'll add the debug function, have to do a diff on in to see what else you changed...

I dont know when i will have time to take a deeper look into your versions.

So for the future could you check out from svn bevore you do some modifications

Here is a Web interface to it

and you can do anonymous checkout from here

pn me your preferred username (and email address if possible) to get an accout.

@the DtTvB

i feel a bit like taking over or so.

But this still is your project.

If you feel like stepped on the toe or...

... i am going to far or...

... something gets added you dont like

Please tell me!

... and could you add links to the repository in the first post please :o

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

  • Replies 171
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Well well...

you should keep in mind the UDF philosophy.

Scripts here should be made as Components Off The Shelf, except those intended to work "as is".

Just remake Abyss web server and get in competition, or provide something new (different).

That is, a standard UDF, a Component Off The Shelf, something another au3 scipt can use.

This has already been done for FTP, POP3, and SMTP.

Seperate add-ons should reslult in separate files; please keep the core focused on what it is aimed to be : a web server and nothing else.

(please ;))

Apzo.

Link to comment
Share on other sites

Why should they? We are trying to make a feature-rich webserver in autoit. Why should we be limmited?

I was planning to make the admin panal localhost only.

also, someone should try to make it authenticate like the htaccess password/username thing. that would be cool.

Link to comment
Share on other sites

Configuration file feature added. It has its own syntax, similar to Apache's configuration file. Here is the syntax rules.

Any line that start with # is ignored. Blank lines are also ignored.

The simple syntax for each configuration line is.

[directive] [value]

String values should be quoted, either with single quote or double quote.

To escape a quote, double it (e.g. 'the DtTvB''s').

For number values, you don't have to add quotes.

Equations are enabled (e.g. sin(3.14) * 2).

AutoIt macros are also enabled (e.g. @AutoItExe).

Some excerpt from the configuration file.

# listenIP
#   - Default: ""
#   - The IP address to listen to.
#   - To listen to all address, you can use "0.0.0.0"

listenIP ""


# listenPort 
#   - Default: 27643
#   - The port number to listen to.
#   - You can go to your site by going to http://localhost:[port]

listenPort 27643

# iRequestTimeout
#   - Default: 20 * 1000
#             (20000, 20 seconds)
#   - The maximum amount of time, in milliseconds, for the client to
#    send the request header.

iRequestTimeout 20 * 1000

# preprocessor_path
#   - Default: @AutoItExe
#   - Path to the executable file of the preprocessor.
#   - The program should output to StdOut, so the web server can read.

preprocessor_path @AutoItExe

Obtain the code via SVN.

Edited by the DtTvB
Link to comment
Share on other sites

embedded?

did some cleanup...

Fixed Preprocessor Truncated Output of Child process
Changed Default Value 'listenPort' to 80 (We don't want the AV Company's to misunderstand...)
Changed Default Value 'autoit_preprocessor_protectionmode' to 0 its easy to exploit and prevents reading the Request!
Removed AU3Check Warnings 
Added server.conf Parser Errors and improved security
Added 'public_html/test.aux' display Request and All Environment Variables
Added 'CONTENT_LENGTH' CGI Variable
Added Cgi like Request forwarding

that protecionmode thing needs some special care...

why do we need this anyway?

if you want to host someone untrusted you probably rather runthe script as unprivileged user, right?

i dont know if pre nt os support this, but we should think about implementing it.

Security for server.conf is a bit too tight for the mime types.

I'll change that in the next days.

Imo we should stick with the cgi standards.

once this is done its possible supporting php, python & friends... ;)

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Imo we should stick with the cgi standards.

once this is done its possible supporting php, python & friends... ;)

Absolutely !

CGI mime types should be defined in the .conf file along with their parser.

Example :

#cgi_EXT,   parser   running path
cgi_exe "" @ScriptDir;unset mime_exe !
cgi_php "C:\php\bin\php" @ScriptDir
cgi_au3 "@AutoItExe /ErrorStdOut /AutoIt3ExecuteScript" @ScriptDir;   For .au3 files with no preprocessor for example.

A function may handle that :

Func _CgiExec($file, $parser, $path)
    Local $data
    If $parser = "" Then
        Local $pid = Run($file,  $path, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD)
    Else
        Local $pid = Run($parser & ' "' & $file &'"',  $path, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD)
    EndIf
    While 1
        $data &= StdoutRead($pid)
        If @error Then ExitLoop
    Wend
    Return $data
EndFunc

Of course this one is minimalist and needs serious improvements, but that's the idea.

Apzo

Edited by Apzo
Link to comment
Share on other sites

we should have a cgi folder for exe files.

and why not configure the interpreters throu mime stuff?

and add a cgi section...

mime_au3  "cgi/AutoIt"
mime_a3x  "cgi/AutoIt"
mime_aha  "cgi/AutoItTags"
mime_ahp  "cgi/AutoItTags"
mime_php  "cgi/php5"
mime_pl  "cgi/perl"

# CGI Config...

CgiBinFolder public_html\cgibin

# this asumes that $sCgiFullPath is available
AutoIt "@AutoItExe /ErrorStdOut /AutoIt3ExecuteScript " & $sCgiFullPath
php5 "C:\php\php.exe -whatever " & $sCgiFullPath

i dont like the $mime_ global variables, i think i'll turn them into an array or two ;)

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

I also don't like the idea of a cgi bin

who else doesn't like it?

I dont need it but it wont hurt to have it...

maybe turned off by Default

i dont like the $mime_ global variables, i think i'll turn them into an array or two ;)

so i did but svn is down.

so i'll post in here :lmao:if someone is bored when svn is back up please commit it...

edit: its not down, but terribly slow...

Edited by piccaso
CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

well apache for instance no longer requires the use of cgi-bin. You can use scripted languages from anywhere in the html working directory.

and if you were referring to using a virtual folder for exacutable scripts I guess. That would not be bad but it would still be extra overhead that is not needed.

Edited by webmedic
Link to comment
Share on other sites

i was referring to executables.

and i don't see much overhead.

but...

I don't need it.

I won't implement it unless i get really bored.

There is so much more useful stuff to do.

Still i won't stand in the way of someone who wants to hack this in.

As long as it's optional.

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

i was referring to executables.

and i don't see much overhead.

but...

I don't need it.

I won't implement it unless i get really bored.

There is so much more useful stuff to do.

Still i won't stand in the way of someone who wants to hack this in.

As long as it's optional.

It's not about hack !

Sometimes it's better to use .exe rather than .au3 (or .ahp for instance).

First, .exe don't need AutoIt to be installed on the runnning computer.

Second : never ever let your collegues play with your scripts ! Especially when those scripts are dealing with security and you're the admin (you know, the bad guy ;))

Such a webserver can make my existing scripts on remote computers easy to manage (and launch).

Some kind of web service.

Apzo.

Link to comment
Share on other sites

ok what I really wanted to say...

Still i won't stand in the way of someone who wants to implement this.

As long as it's optional.

but doing this right now would be a hack...

I'll see how i could implement the config file features i suggested above

if this is done it would be easier

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

it works with php now ;)

but you have to install it:

download it from here

install it into @ProgramFilesDir & "\PHP\" or change the path in server.conf

make sure you install 'Other CGI' Web Server Setup (Setup will ask you for that)

I'm not sure if it works right...

so who knows php good enough to test it :lmao:

WebServer_1.3_Beta.zipsorry spyro i had to scratch your preprocessor to support the 'New way of setting up cgi'

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

By the way, I thought about new name, what about "AutoIt Community Web Server?"

How about...

au3HTTPd - The AutoIT Community Web Server

if there is no conflict with the law and john doesn't mind that we use that name

i want a small name for it too ;)

and acws would be American Civil War Society

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...