开发者

Embeding a Web Server in a Cocoa Application

I want to embed a simple web server into a cocoa application that can support dynamic operations, like processing form submissions. It should all be contained in the app. My first thought would be to include a Rails server, but somet开发者_如何学JAVAhing about that seemed wrong. Are there any examples of people integrating a web server in their app?


More info: I've been looking at cocoahttpserver (http://code.google.com/p/cocoahttpserver/) but it would be nice to have an embeddable server which supported output templates like rails, php, django, etc.


I've prototyped somethign that uses a combination of CocoaHTTPServer and MGTemplateEngine. Here's the current GIT repo for the full app in progress: http://github.com/jgillick/Ganzbot-Controller

Look at GanzbotServer.m for how I wired those two libraries together. (FYI: You need to install RegexKit to get MGTemplateEngine to compile)


ComicFlow is an open-source comic reader for iPad which embeds a web server so you can see exactly how it's done.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜