开发者

Embeding a Web Server in a Cocoa Application

开发者 https://www.devze.com 2022-12-16 18:55 出处:网络
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

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

精彩评论

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

关注公众号