Search the Community
Showing results for tags 'CGI'.
-
This is yet another HTTP server written in AutoIt3. Originally based on jvanegmond's POST HTTP Server. It is designed to be used either as is, or by scripts for a HTTP communication between any browser and AutoIt3. It can run PHP and AutoIt3 CGI, if setup in the settings ini file. Github repository AutoIt-HTTP-Server-master.zip
- 1 reply
-
- http server
- http
-
(and 1 more)
Tagged with:
-
Au3_FastCGI Arck System. Version 0.1 Beta alpha version ( proof of concept ). Version 0.1 Beta * What is it ? Au3 FastCGI is a CGI handler that will run constantly to get request from webservers The process will send back html code to the webserver. It’s the same as php or other language that acts as cgi. FastCGI is powerful since CGI spawn a process on each request. FastCGI works with TCP connection, so it’s always started to handle request. Some reads : http://www.fastcgi.com/drupal/ Features : This udf enables FastCGI to be used with autoit. FastCGI is used by a lot of webservers ( mainly to use php ) to call functions written in other languages. Its main purpose is too use sockets on existants processes instead of stdios to send/receive result and spawn process. With is, you can spawn your fastcgi “listener” then let it run. A service is in preparation to do so. You can use any webserver that support FastCGI. Lighttp, apache, and more, make a total third part architecture. The webserver with your firewall can run in linux and Au3_fastcgi_Server can run on a dedicated server. Multiple instances can run, so many processes can run, to avoid contention and make a bigger webserver. This UDF uses TCP_Event by kip to boost performances. ( avoid loop )Bininbinary by ward to fastcheck only needed informations. ( avoid uses of multiple structure, can gain 1-2 ms ) ( will be in proper version ) ( not used in FastCGI_Lite )For now, this udf lets you make webservers in autoit with easy integration. By detaching webserver and fastcgi, you can easily update your webserver.I’ve attached a script that you rerun your script in scite to test. Simply right-click on autoit icon when running, then click restart, and it will close and tells cite to reload it. Be careful, scite will run active tab. To use it, you have to think this way : The main process will handle all of your process code. You have to let the engine function, then add your functions to test it. When you call http://localhost/test.au3, the script will call “test” function. If the function doesn’t exists, a custom 404 error is thrown. For now, you can’t set subpages ( like /somepages/test/index.au3 ) only “root” can be called. The Fast CGI Lite script is my paperboard. You can execute it and test some pages, but it will changed often in the future. Please test your script in an external file. HOW TO RUN First of all, start the ServerControl.exe, then click start, and reduces it if everything ok. If another process is listening to port 80, close it, or change port in ligttpd config files. Open Au3_FastCGI_Lite.au3 in Scite and run it Open your favorite webbrower and type http://localhost/index.au3 You should see a 404 custom page Now go to http://localhost/_all.au3 TO DO LIST Add SubPages SupportAdd GZip support ( should be on lighttp size, don’t know)Add ability to send/receive files and process themAdd Multiple process exampleAdd Session ID or something like thatBenchmark TCP Event <> TCP Loop LIMITATIONS Your code must contain engine code. All of your pages must be functions ( for now, I plan to make something different with an array soon ) All au3 code must be added in. You can btw use external files to make more. AutoIt can’t compile code on the fly (as php does ), so your “listener” must be fully stopped and restarted to test changes. Doesn’t support session id ( for now ) DOWNLOAD http://www.2shared.com/file/UmS1x9Hv/FastCGI.html
-
Ok, I don't know if this is even possible but some help would be greatly appreciated. I've been googling like crazy and trying different things but i'm just not getting anywhere. I'm trying to control an arduino from an Autoit script ... over the web. I have a script that is working and i have serial communication figured out. currently the script is simple and turns a couple of relays on and off. what i'd like now is to do this from a webpage. ideally a gui interface like the one i have now would be great but i've also tried using cgi to launch a script that turns on a relay (so two links one to run a script to turn on and one to turn off) but after the script runs i get an error page. I'd like to set it up where if i can't have the gui then i can click the link run the script but stay on the same page. I hope all of this is making sense. Here is a copy of the gui script that is working: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;Include the Serial UDF #include 'CommMG.au3' #include #include #include #include #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 301, 221, 192, 124) $Label1 = GUICtrlCreateLabel("Circuit 2", 32, 88, 42, 17) $Label2 = GUICtrlCreateLabel("Circuit 1", 32, 32, 42, 17) $Checkbox1 = GUICtrlCreateCheckbox("ON", 32, 56, 33, 17) $Checkbox2 = GUICtrlCreateCheckbox("OFF", 72, 56, 41, 17) GUICtrlSetState(-1, $GUI_CHECKED) $Checkbox3 = GUICtrlCreateCheckbox("ON", 32, 112, 33, 17) $Checkbox4 = GUICtrlCreateCheckbox("OFF", 72, 112, 41, 17) GUICtrlSetState(-1, $GUI_CHECKED) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;Internal for the Serial UDF Global $sportSetError = '' ;COM Vars Global $CMPort = 4 ; Port Global $CmBoBaud = 9600 ; Baud Global $CmboDataBits = 8 ; Data Bits Global $CmBoParity = "none" ; Parity Global $CmBoStop = 1 ; Stop Global $setflow = 2 ; Flow ;Start up communication with the Arduino _CommSetPort($CMPort, $sportSetError, $CmBoBaud, $CmboDataBits, $CmBoParity, $CmBoStop, $setflow) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _commsendstring("10" & @CR) _commsendstring("20" & @cr) Exit Case $Checkbox1 guictrlsetstate($Checkbox1, $GUI_CHECKED) GUICtrlSetState($Checkbox2, $gui_unchecked) _CommSendstring("11" & @CR) Case $Checkbox2 GUICtrlSetState($checkbox2, $GUI_CHECKED) GUICtrlSetState($Checkbox1, $gui_unchecked) _CommSendString("10" & @CR) Case $Checkbox3 guictrlsetstate($Checkbox3, $GUI_CHECKED) GUICtrlSetState($Checkbox4, $gui_unchecked) _CommsendString("21" & @cr) Case $Checkbox4 guictrlsetstate($Checkbox4, $GUI_CHECKED) GUICtrlSetState($Checkbox3, $gui_unchecked) _commsendstring("20" & @cr) EndSwitch WEnd Thank you in advance