HTTPKit — A lightweight HTTP server framework for Objective-C
github.com
github.com
This works on Cocoa an iOS and supports:
- Built in support for bonjour broadcasting
- IPv4 and IPv6 support
- Asynchronous networking using GCD and standard sockets
- Password protection support
- SSL/TLS encryption support
- Extremely FAST and memory efficient
- Extremely scalable (built entirely upon GCD)
- Heavily commented code
- Very easily extensible
- WebDAV is supported too!
(Not the author, just a user).1) you've got a lot of spare time on your hands and wanted to test your skills and show your love for a language. Based on the outlandish hello world example (which is useless for most web developers), this is most likely.
2) you had some ridiculous constraints and really absolutely had to build a web sever in objective-c. In this case, a better use case or example would be appreciated.
Here's the first web app to be written using it: https://github.com/fjolnir/experience-tranquility
4) You find that the very small amount of spare time this sort of thing takes is worth it, even if just for kicks.
5) You miss WebObjects.
6) In addition to having code commonality, you might be interested in performance that allows you to not have to worry about scaling out for much much longer than other common solutions (or requiring rewrites if you're successful). For example, my own embedded Objective-C web lib (based on libmicrohttp) clocks in at around 30K requests/second even when initialized via script on my laptop, whereas something like Sinatra does around 900.
http://blog.metaobject.com/2012/03/30k-requests-aka-wrk-is-f...
http://blog.metaobject.com/2011/12/ruby-and-rails-scalabilit...
7) You think textual verbosity is a good thing when it adds to readability.
8) You want to embed a web-server in your iOS and/or MacOS X app. Peer to peer, like the Internet was originally intended. While it may be possible to achieve with RoR or Sinatra or the like, an ObjC lib is just less hassle.
FTFY :)
In other words: there was a WebObjects after v4? ;-)
This means my customers needn't download a special app on their desktops and I don't need to write them.
As for verbosity -- Objective-C stylistically tends to be a little more verbose than other languages (named arguments, no abbreviations, verb-object structured method names). It doesn't need to be but it tends to be as a matter of tradition.
That said, for what it's doing (setting up a web server with 3 different responses and error handling), this is not particularly verbose.
I do plan to make it compile with ObjFW, with which it would run pretty much anywhere. Without any hard to set up dependencies.
While I don't know about this kit in particular, I've had good results with both Cocotron and GNUStep in getting ObjC/Cocoa code to Linux and Windows.
Recently, I also had some Objective-C code running on my Android phone, but that sort of thing is experimental and not well-supported yet.
http://wiki.gnustep.org/index.php/Platform_compatibility
I also had a large-ish system running on AIX.
Never looked too much into GNUStep, because it is not clear to me how far Cocoa and the latest language changes from Apple are supported by gcc and clang + GNUStep.
On my line of work it is the customers that decide the technology, not me, so they have a hard time thrusting Objective-C outside Apple's environment.