Busti Posted August 27, 2007 Share Posted August 27, 2007 (edited) Hi all, im Releasing an Alpha version of my "AutoIT-WebServer".The Example should explane everything.Links and Downloads don't work yet . I Hope i get 'em working.Example :expandcollapse popup#include <_AutoITWEB.au3> $aSocket = _WebServer_StartWebServer() _WebServer_LoadHTML( @ScriptDir & "\index.html" ) While 1 _WebServer_AcceptConnection($aSocket) WEnd ; Dont Remove this Function, or _AutoITWEB.au3 won't work. Func _WebServer_OnConnect($x) _WebServer_LoadHTML( @ScriptDir & "\index.html" ) ; reloads index.html everytime a user connects. _WebServer_ServerLog( "-- ]Incomming IP: "& _WebServer_ClientIP($x),1) EndFuncoÝ÷ Ø Ö®Ý«¢+Ø¥¹±Õµ½¹(¥¹±Õ±ÐíMÑÉ¥¹¹ÔÌÐì(í±½° ½¹ÍѹÌ(íUÍȹÐMÑÑ¥¹Ì)±½° ½¹ÍÐÀÌØí}UMI} ! -}%@ôÄ)±½° ½¹ÍÐÀÌØí}UMI}}%@ôÄ(í±½°¥±MÑÑ¥¹Ì)±½° ½¹ÍÐÀÌØí}%1} IQ}1=ôÄ)±½° ½¹ÍÐÀÌØí}%1}1=}95ôÅÕ½ÐíÍÉÙȹ±½ÅÕ½Ðì)±½° ½¹ÍÐÀÌØí}%1}YIM%=8ôÅÕ½ÐìÀ¸ÀıÁ¡ÅÕ½Ðì)±½° ½¹ÍÐÀÌØí}%1}Y%M%Q=I}95ôÅÕ½ÐíY¥Í¥Ñ½É̹ÐÅÕ½Ðì)±½°ÀÌØí}%1}Y%M%Q=ILô¥±I ÀÌØí}%1}Y%M%Q=I}95¤)±½°ÀÌØí}%1}M I%AQ}Q%Q1ôÅÕ½ÐìÅÕ½Ðì)±½°ÀÌØí}%1}!Q51} =dôÅÕ½ÐìÅÕ½Ðì)±½°ÀÌØí}%1}!Q50ôÅÕ½ÐìÅÕ½Ðì)±½°ÀÌØí}%1}UM%9}%1ôÀ)±½°ÀÌØíUÍÉ¥±ôÅÕ½ÐíUÍȹÐÅÕ½Ðì°ÀÌØí¹ÑÉå9µôÅÕ½Ðí%@ÅÕ½Ðì)±½°ÀÌØíM½ÐôÀ(íMÉÙÈMÑÉеUÀ)}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´uMÑÉÑ¥¹ÕÀm u]µMÉÙȸ ÅÕ½ÐìµÀìÀÌØí}%1}YIM%=8µÀìÅÕ½Ðì¤ÅÕ½Ðì°Ä¤()Õ¹}]MÉÙÉ}ÁÑ ½¹¹Ñ¥½¸ ÀÌØíM½Ð¤(%±½°ÀÌØíM½ÐôQ AÁÐ ÀÌØíM½Ð¤($ì!¥È½µµÐ¹½ ÈQ¥°µ¥Ð¸%@MÙ¥¹Ñ¸(%%ÀÌØíM½ÐÐìôÀQ¡¸($%}]MÉÙÉ}=¹ ½¹¹Ð ÀÌØíM½Ð¤($%Q AM¹ ÀÌØíM½Ð°ÀÌØí}%1}!Q50$¤($$ÀÌØí}%1}Y%M%Q=IL¬ôÄ($%¥±±Ñ ÀÌØí}%1}Y%M%Q=I}95¤($%¥±]É¥Ñ ÀÌØí}%1}Y%M%Q=I}95°ÀÌØí}%1}Y%M%Q=IL¤(%¹%(%IÑÕɸQ A ±½ÍM½Ð ÀÌØíM½Ð¤)¹Õ¹()Õ¹}]MÉÙÉ}M¹9Ý!ѵ° ÀÌØíà¤(%Q AM¹ ÀÌØíà°ÀÌØí}%1}!Q50¤)¹Õ¹()Õ¹}]MÉÙÉ}1½!Q50 ÀÌØí±¥¹¬¤($ÀÌØí}%1}!Q50ô¥±I ÀÌØí±¥¹¬¤)¹Õ¹()Õ¹}]MÉÙÉ}MÑÉÑ]MÉÙÈ ÀÌØí±¥ÍѸõ%AÉÍÌÄ°ÀÌØíÁ½ÉÐôØÄÄÈ°ÀÌØí½¹¸ôÄÀÀ¤(%±½°ÀÌØí}%1}5a} =99 Q%=9LôÀÌØí½¹¸(%±½°ÀÌØí}%1}A=IPôÀÌØíÁ½ÉÐ(%±½°ÀÌØí}%1}1%MQ9}%@ôÀÌØí±¥ÍѸ(%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´%uQ AMÑÉÑÕÀ ¤ÅÕ½Ðì°Ä¤(%Q AMÑÉÑÕÀ ¤($íÁÐ%¹½µ¥¹ ½¹¹Ñ¥½¹Ì(%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´%uQ A1¥ÍѸ ÅÕ½ÐìµÀìÀÌØí}%1}1%MQ9}%@µÀìÅÕ½Ðì°ÅÕ½ÐìµÀìÀÌØí}%1}A=IPµÀìÅÕ½Ðì°ÅÕ½ÐìµÀìÀÌØí}%1}5a} =99 Q%=9LµÀìÅÕ½Ðì¤ÅÕ½Ðì°Ä¤($ÀÌØíM½ÐôQ A1¥ÍѸ ÀÌØí}%1}1%MQ9}%@°ÀÌØí}%1}A=IP°ÀÌØí}%1}5a} =99 Q%=9L¤($ÀÌØíÙÉɽÈôÉɽÈ(%%ÀÌØíM½Ðô´ÄQ¡¸($%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´uÉɽȽ¸1¥¹èÅÕ½ÐìµÀìMÉ¥ÁÑ1¥¹9յȵÀìÅÕ½Ðì¼ÅÕ½ÐìµÀìMÉ¥ÁÑ9µ°Ä¤($%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´uÉɽÈôÅÕ½ÐìµÀìÀÌØíÙÉɽȰĤ($%%ÀÌØíÙÉɽÈôÄQ¡¸($$%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´u]ɽ¹%@ÉÍ̸ÅÕ½Ðì°Ä¤($$%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´u½ÉÑ¥¹MÑÉиÅÕ½Ðì°Ä¤($$%IÑÕɸ´ÈíÝɽ¹¥À($%±Í%ÀÌØíÙÉɽÈôÈQ¡¸($$%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´u]ɽ¹A½ÉиÅÕ½Ðì°Ä¤($$%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´u½ÉÑ¥¹MÑÉиÅÕ½Ðì°Ä¤($$%IÑÕɸ´ÌíÝɽ¹Á½ÉÐ($%±Í($$%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´%uU¹½Ý¸ÉÉ½È ÅÕ½ÐìµÀìÀÌØíÙÉɽȵÀìÅÕ½Ðì¤ÅÕ½Ðì°Ä¤($%¹%(%±Í($%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´%uMÉÙÈ¥Ì1¥Íѹ¥¹MÕÍÍÕ±±ä¸ÅÕ½Ðì°Ä¤($%}]MÉÙÉ}MÉÙÉ1½ ÅÕ½Ðì´´%uM½ÐèÅÕ½ÐìµÀìÀÌØíM½Ð°Ä¤($%IÑÕɸÀÌØíM½Ð(%¹%)¹Õ¹()Õ¹}]MÉÙÉ} ±¥¹Ñ%@ ÀÌØíM½Ð¤($ÀÌØí%@ô}M½ÑQ½%@ ÀÌØíM½Ð¤(%IÑÕɸÀÌØí%@)¹Õ¹()Õ¹}]MÉÙÉ}MÉÙÉ1½ ÀÌØíÍQáаÀÌØí͹ÑÈôÀ¤(%%ÀÌØí}%1} IQ}1=ôÄQ¡¸($$ÀÌØíÍôÅÕ½ÐìÅÕ½Ðì($%%ÀÌØí͹ÑȱÐìÐìÀQ¡¸ÀÌØíÍô I1($%¥±]É¥Ñ ÀÌØí}%1}1=}95°ÀÌØíÍQáеÀìÀÌØíͤ(%¹%)¹Õ¹(ìQ¡¹ÌѼÕѽ%P!±Àµ¥±¸)Õ¹}M½ÑQ½%@ ÀÌØíM!= -P¤(1½°ÀÌØíͽÈô11MÑÉÕÑ ÉÑ ÅÕ½ÐíÍ¡½ÉÐíÕÍ¡½ÉÐíÕ¥¹Ðí¡ÉlátÅÕ½Ðì¤((1½°ÀÌØíIÐô11 ±° ÅÕ½Ðí]ÌÉ|Ìȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíÑÁɹµÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØíM!= -P°|(ÅÕ½ÐíÁÑÈÅÕ½Ðì±11MÑÉÕÑÑAÑÈ ÀÌØíͽȤ°ÅÕ½Ðí¥¹Ñ}ÁÑÈÅÕ½Ðì±11MÑÉÕÑÑM¥é ÀÌØíͽȤ¤(%9½ÐÉɽȹÀÌØíIÑlÁtôÀQ¡¸(ÀÌØíIÐô11 ±° ÅÕ½Ðí]ÌÉ|Ìȹ±°ÅÕ½Ðì°ÅÕ½ÐíÍÑÈÅÕ½Ðì°ÅÕ½Ðí¥¹Ñ}¹Ñ½ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì±11MÑÉÕÑÑÑ ÀÌØíͽȰ̤¤(%9½ÐÉɽÈQ¡¸ÀÌØíIÐôÀÌØíIÑlÁt(±Í(ÀÌØíIÐôÀ(¹%((ÀÌØíͽÈôÀ((IÑÕɸÀÌØíIÐ)¹Õ¹Working Commands Yet :_WebServer_StartWebServer($ListenIP,$Port,$MaxConnections) _WebServer_AcceptConnection($Socket) _WebServer_LoadHTML($File) _WebServer_ClientIP($Socket) _WebServer_ServerLog($Text) _WebServer_AcceptConnection($Socket)Have Fun PS: Test the Server on : http://wowhack.servehttp.com:6112/ Edited August 27, 2007 by Busti My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
James Posted August 27, 2007 Share Posted August 27, 2007 (edited) Why dont the links work? Just copy files to your server. Very nice though! You should add error pages Edited August 27, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Busti Posted August 27, 2007 Author Share Posted August 27, 2007 (edited) I'm still thinking about, how to get the link which the user clicked Edited August 27, 2007 by Busti My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
James Posted August 27, 2007 Share Posted August 27, 2007 What do you mean? Link the files in HTML: <a href="myfile.txt">Download myfile.txt</a> Then in the place where you keep your webpages (htdocs maybe) copy/create a file called myfile.txt, then when the user clicks the link it will download. Its how HTML works. -James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Busti Posted August 27, 2007 Author Share Posted August 27, 2007 i Know, but my server wont give him the file, thats the problem... i need something like this : User clicks on a link, i cann see the url the user typed, extract filename, send him the filename requestet. if the filename is not found, i send him the Errorpage. you understand what i mean ? My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
James Posted August 27, 2007 Share Posted August 27, 2007 Yes. But I dont see why its not working. Whats the HTML source and where are the files? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Busti Posted August 27, 2007 Author Share Posted August 27, 2007 HTML : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Busti's AutoIT Web-Server</title> </head> <body> <center><h1>Hello, this is my Site... in AUTOIT!</h1> <b><br><br> See what AUTOIT! can do..!<br> if i use a Extern File, i can change the text all the time without to restart the Server :-)<br> You can Create a Complete Website here too :D.</b><br><br> <font color=#FF0FF0>You can Write in Color's</font><br> <font face="lucida console">Or Change the Font...</font><br> <font size="6">....Size</font><br> <font color=#FF000F face="arial">Write in Colors and Change the Font</font><br> <font color=#F0F00F face="arial" size="2">Write in Colors and Change the Font and the Size</font><br><br> <a href="test.rar" alt="test-file">Download File : test.rar</a><br> <a href="index2.html">move..your...asssss!!!</a><br> <a href="index2.html" target="_blank">test</a><br><br> The 3 links above dont work yet... sry :(<br> </center> </body> </html> My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
James Posted August 27, 2007 Share Posted August 27, 2007 Looks ok to me.. Do youhave FTP? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
jvanegmond Posted August 27, 2007 Share Posted August 27, 2007 The problem is you are not using HTTP. You are just trying things that work, and when something goes right it is completely coincidental. Read RFC2616 for more information.The first thing you should start on is parsing GET commands and sending back a page the proper way! Because I doubt what you are doing now works in any other browser then Internet Explorer. I know Mozilla will refuse.By the way, I already looked up RFC2616 for you: http://www.faqs.org/rfcs/rfc2616.html github.com/jvanegmond Link to comment Share on other sites More sharing options...
Busti Posted August 27, 2007 Author Share Posted August 27, 2007 it's working with Mozilla oO..^^ And thx, i will have a look @ it. My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now