An Objective-C WebServer with WebSockets support implemented using BSD's POSIX socket APIs and utilizing Grand Central Dispatch for multithreading.
The routing API is heavily inspired by Express.js (my actual preference for building web applications) and the repository also includes a very basic simple ncurses-based CLI.
[server on:GET path:@"/" execute:^(Request* request, Response* response){
[response append:@"<p>hi</p>"];
}];
[server onWebSocketConnection:@"/echo" execute:^(Request* request, WebSocket* socket){
[socket onMessage:^(NSString* message){
// Simply sends the received message back to the client.
[socket sendString:message];
}];
}];
- Fast and lightweight.
- Fully asynchronous handlers for HTTP requests.
- Supports CRUD methods (
GET
,POST
,PUT
,PATCH
,DELETE
). - Express.js-derived API emphasizing readability.
- IPv4 support.
- WebSocket support out of the box.