AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sparrow: AHK WebServer w/ AHK in HTML support (sources incl)
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
derRaphael



Joined: 23 Nov 2007
Posts: 841
Location: ~/.

PostPosted: Wed Oct 22, 2008 1:19 pm    Post subject: Reply with quote

Slanter wrote:
Found an error when using this on Win2k SP4.

twhyman wrote:
i am on vista x64 and it crashes here too.


atm the crashes are an yet unresolved problem. while posting data to sparrow, the script tries to do several things at the same time, which is due to limitations of my code and some limitations of ahk not possible.

while reading incoming data the script interprets the fields and is unabled to serve other requests. when other requests come in the script generates internal winsock errors and cannot recover from them. the only possible fix i see at this point is to exclude the interpreter to a spawned child and have it communicate to core via IPC ... but this is a rather time critical issue and results in many different other problems. such as missing WM_* msgs from core. i am experimenting on this but not usable solution is found yet.

twhyman wrote:
And how can we compile it to an exe so we can do All in 1 web service script?
I tried compiling the core ahk but it does not work as a single exe, also tried to include the rest of the ahk file in the main folder but with no success.

Thanks
Twhyman


compiling needs the autohotkey.exe to be included. the scripts which are embedded into html code are started dynamically via lexikos' piperun. when being compiled, this part completly loses its functionality and the scripts wont work, since not interpreter can be launched to start the scripts.

when above described problem hopefully gets fixed, i'll rewrite the code to use my winsock2.ahk lib. this will also result in a cleaner more readable code, since all networking functions get abstracted with more meaningfull names.

probably lexikos will create a interpreter version of ahk which is capable of executing dynamically passed scripts as he described in his piperun thread.

doing a webserver with AHK is quite a challenge because many things are very timecriticall. along with structural problems of the script my hardware seems to break (generating unreproducable memory errors) which makes coding slightly more difficult, since on every error i have to find out is it my script or my computer...

to fix all these mentioned problems (excluding my hardware issues) i need to read more about winsock functionalities and take a very close look at the design of the core to avoid running into other difficulties.

thanks for all the comments so far.

greets
dR
_________________

    All scripts, unless otherwise noted, are hereby released under CC-BY
Back to top
View user's profile Send private message
twhyman



Joined: 07 Dec 2005
Posts: 339

PostPosted: Wed Oct 22, 2008 1:34 pm    Post subject: Reply with quote

Thanks a lot for the explenation Smile

Is it possible to activate the hkml interpreter on apache or IIS?

One more question will sparrow will be ever able to run as a single exe webservice?

Hope i am not driving you crazy with all of my questions Embarassed because i would really want to see AHK being able to function as a web service.

Thanks again for your efforts,
Twhyman
_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Last edited by twhyman on Wed Oct 22, 2008 1:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
Chavez



Joined: 20 Aug 2008
Posts: 256

PostPosted: Wed Oct 22, 2008 1:36 pm    Post subject: Reply with quote

This would be cool in combination with an AHK browser. Like, a browser that enables the execution of AHK scripts. For example, the codes on this forum could include a button with a caption like 'Try' or 'Run' which will run the AHK code upon click.
_________________
-Chavez.
Back to top
View user's profile Send private message MSN Messenger
derRaphael



Joined: 23 Nov 2007
Posts: 841
Location: ~/.

PostPosted: Wed Oct 22, 2008 3:48 pm    Post subject: Reply with quote

Chavez wrote:
This would be cool in combination with an AHK browser. Like, a browser that enables the execution of AHK scripts. For example, the codes on this forum could include a button with a caption like 'Try' or 'Run' which will run the AHK code upon click.


u can easily create such a browser by implementing sean's IE and COM methods into an AHK script and use AHKlerner's JS injection (or using lexikos dispatch methods directly) for HTML pages ... with some RegExReplacements on the HTML source from each of the displayed forum pages, and some lil Ahk code, u'd easily 'inject' a "save that script" or "run directly" button / link into that page.

ez

Cool
_________________

    All scripts, unless otherwise noted, are hereby released under CC-BY
Back to top
View user's profile Send private message
silkcom



Joined: 23 Jan 2008
Posts: 162

PostPosted: Wed Oct 22, 2008 8:11 pm    Post subject: Reply with quote

Freakin sweet. This is EXACTLY what i've wanted to make for web applications that help you to control common computer tasks. Something that only you access. Very Very very nice. Keep up the good work.
Back to top
View user's profile Send private message
Chavez



Joined: 20 Aug 2008
Posts: 256

PostPosted: Thu Oct 23, 2008 5:49 am    Post subject: Reply with quote

DerRaphael wrote:
Chavez wrote:
This would be cool in combination with an AHK browser. Like, a browser that enables the execution of AHK scripts. For example, the codes on this forum could include a button with a caption like 'Try' or 'Run' which will run the AHK code upon click.


u can easily create such a browser by implementing sean's IE and COM methods into an AHK script and use AHKlerner's JS injection (or using lexikos dispatch methods directly) for HTML pages ... with some RegExReplacements on the HTML source from each of the displayed forum pages, and some lil Ahk code, u'd easily 'inject' a "save that script" or "run directly" button / link into that page.

ez

Cool


...you lost me after 'You can' Laughing
_________________
-Chavez.
Back to top
View user's profile Send private message MSN Messenger
silkcom



Joined: 23 Jan 2008
Posts: 162

PostPosted: Fri Oct 24, 2008 8:46 pm    Post subject: Reply with quote

Can someone plz help me to turn this server into an EXE. would be very nice if absolutely everything could be compiled down to 1 exe, and 1 ini file (for port settings, etc.)

When i try to compile this it doesn't seem to get all the include files and such, and I've written a small website in hkml and would like to put it on a pc with no AHK.

any ideas, any help? It's freakin sweet I must say that (again). Perfect for making small "applications" that are web based but only really used in a local network situation.
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1381
Location: USA

PostPosted: Fri Oct 24, 2008 8:51 pm    Post subject: Reply with quote

u cant make it one exe.
_________________

ʞɔпɟ əɥʇ ʇɐɥʍ
Back to top
View user's profile Send private message
silkcom



Joined: 23 Jan 2008
Posts: 162

PostPosted: Fri Oct 24, 2008 11:45 pm    Post subject: Reply with quote

do u care to expound? (cant is a strong word to a programmer Smile you can do anything, it's just a question of if it's worth the time)
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1381
Location: USA

PostPosted: Sat Oct 25, 2008 1:19 am    Post subject: Reply with quote

silkcom wrote:
do u care to expound? (cant is a strong word to a programmer Smile you can do anything, it's just a question of if it's worth the time)

well you can u just have to fileinstall the autohotkey.exe and make sure all of the script lines pointing to it are changed...im not sure what else you would have to fileinstall, as i have not reviewed the script in detail.....i just read in previous post by the creator (DerRaphael) that the script needs autohotkey.exe
_________________

ʞɔпɟ əɥʇ ʇɐɥʍ
Back to top
View user's profile Send private message
derRaphael



Joined: 23 Nov 2007
Posts: 841
Location: ~/.

PostPosted: Sat Oct 25, 2008 2:04 am    Post subject: Reply with quote

compiling the sources to make it a single exe is not the problem, even to make it load its settings from an ini file ...

what makes it a problem is the HKML ... its execution relies on having an autohotkey.exe available which needs to be included into the compiled exe.

imagine it like this


and because the embedded hkml scripts are executed via autohotkey.exe the whole interpreter needs to be included aswell. this sorta doubles the needed space and is slower at execution (compiled scripts are slower than script executed directly) so a compiled sparrow would be about ~ 450kb.

dR
_________________

    All scripts, unless otherwise noted, are hereby released under CC-BY
Back to top
View user's profile Send private message
silkcom



Joined: 23 Jan 2008
Posts: 162

PostPosted: Sat Oct 25, 2008 4:27 am    Post subject: Reply with quote

Smile thank you that makes tons more sense.

I wonder however, if you could write the site, and then compile the site directly in. Or create one that allows you to compile the site in. With images seperate is ok (and almost required). In fact, i'd like all css files and such to be external. But if all the html files were compiled in that would be even cooler than my first thought. Then the whole thing would be 1 thing, that would be great.
Back to top
View user's profile Send private message
twhyman



Joined: 07 Dec 2005
Posts: 339

PostPosted: Sun Oct 26, 2008 10:01 am    Post subject: Reply with quote

DerRaphael wrote:
compiling the sources to make it a single exe is not the problem, even to make it load its settings from an ini file ...

what makes it a problem is the HKML ... its execution relies on having an autohotkey.exe available which needs to be included into the compiled exe.

imagine it like this


and because the embedded hkml scripts are executed via autohotkey.exe the whole interpreter needs to be included aswell. this sorta doubles the needed space and is slower at execution (compiled scripts are slower than script executed directly) so a compiled sparrow would be about ~ 450kb.

dR


Can we set in the settings ini file the autohotkey.exe location? instead of compiling him in the core?
_________________
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.
Back to top
View user's profile Send private message
freakkk



Joined: 29 Jul 2005
Posts: 179

PostPosted: Sun Oct 26, 2008 11:33 am    Post subject: Reply with quote

twhyman wrote:
Can we set in the settings ini file the autohotkey.exe location? instead of compiling him in the core?
A simple alternative; copy the autohotkey.exe to the same folder as sparrow.Core.ahk, & make an autohotkey.ini file (in same folder too) that just has
Code:
#include sparrow.Core.ahk

Now when you want to launch sparrow from a computer that doesn't have ahk installed, you can just run the autohotkey.exe. Very Happy
_________________
.o0[ corey ]0o.
Back to top
View user's profile Send private message
silkcom



Joined: 23 Jan 2008
Posts: 162

PostPosted: Mon Oct 27, 2008 7:14 pm    Post subject: Reply with quote

i'll try that out. I still think it would be cool to be able to compile all ur files into 1 exe, so that autohotkey.exe wouldn't be necessary, and all your hkml files would be already compiled in. Though i'm talking a large change here.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 3 of 7

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group