English 中文(简体)
Embed webserver in carbon bundle
原标题:

I need to embed a tiny webserver in a compiled jsfl external library for Adobe Flash CS4 so that an outside process can communicate with it. The external library will be a Carbon bundle on Mac and a set of dlls on Windows, so the webserver will need to be embedded/loaded from C/C++ code with no external dependencies like Ruby. Most of the tiny webservers like fnord or mini-httpd have never been ported to the Mac or Windows but are mostly intended to be compiled on Linux. I was thinking of using a Lua based embedded webserver but not sure if that would work or not. Are there any embedded webservers that are easier than others to port to Windows and Mac?

最佳回答

All right, I finally answered this. After evaluating several webservers I found a gem, Mongoose. Mongoose is a very small embeddable web server written in C that compiles and runs easily on Linux, Mac, and Windows (there is an even a link in the wiki to getting it to run on the iPhone). Many webservers say they do this but Mongoose was really easy to get up and running. It just did exactly what I expected a little web server to do with minimal fuss. My previous approach, to use libevent or libev, I found a bit too hard, mostly because of threading issues I faced with my main GUI thread. Mongoose came with support for CGI and PHP but I actually found the C based handlers very easy to write so I stuck with that.

问题回答

Webrick and Mongrel run on both.

I thought of one other idea that is easier than Lua that I will try: using a webserver built with libevent. All I really need to do is serve up one file and I don t need any other HTTP features so something like the following might work:

http://3.rdrail.net/blog/libevent-webserver-in-40-lines-of-c/

I will report back.





相关问题
2 mysql instances in MAC

i recently switched to mac. first and foremost i installed xampp. then for django-python-mysql connectivity, i "somehow" ended up installing a seperate MySQL. now the seperate mysql installation is ...

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Controlling OSX windows

I m trying to control windows of a foreign OSX applications from my application. I d like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window ...

Switching J2SE versions on Mac OS (SnowLeopard)

My current JDK on Mac OS (10.6) is set to 1.6 and I d like to switch to 1.5. A listing of /System/Library/Frameworks/JavaVM.framework/Versions/ shows: lrwxr-xr-x 1 root wheel 10 Nov 3 18:34 ...

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

export to MP3 from quicktime API

A question for Apple,QT programmers. Would like to know if it s possible to export a Movie object to MP3 using the QuickTime API. Preferably the ConvertMovieToFile function. I ve looked at ...

热门标签