GithubHelp home page GithubHelp logo

chenxy / mongoosedaemon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from face/mongoosedaemon

0.0 2.0 0.0 165 KB

An objective-c wrapper for embedding the mongoose http web server in iPhone apps

Home Page: http://myutil.com/2009/6/15/simple-way-to-embed-a-http-server-into-your-iphone-app

License: BSD 3-Clause "New" or "Revised" License

mongoosedaemon's Introduction

MongooseDaemon

MongooseDaemon is an objective C wrapper around the embedable mongoose http server for iPhone development. It is offered under a BSD style license.

MongooseDaemon is ideal for both embedded http services as well as simply debugging your iPhone applications file structure.

Mongoose is a lightweight embedable http server written by Sergey Lyubka and offered under a BSD style license. More information on mongoose can be found at the project’s site here: code.google.com/p/mongoose/

NOTE: The mongoose.h and mongoose.c are taken directly from mongoose-2.6 and are unmodified. They are simply forked in this package for convenience and stability.

Usage

Clone the mongoose directory and add it to your X-Code project.

Then you can start it within one of you classes to provide http access to your iPhone application.

For example, to start MongooseDaemon when your application starts on port 8080:

Add the following to MyAppDelegate.h:

...
#import "MongooseDaemon.h"
....
@class MongooseDaemon

@interface MyAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
  ...
  MongooseDaemon    *mongooseDaemon;
  ...
}

And add the following to MyAppDelegate.m:

...
@implementation LightyAppDelegate
...
- (void)applicationDidFinishLaunching:(UIApplication *)application {
mongooseDaemon = [[MongooseDaemon alloc] init];
[mongooseDaemon startMongooseDaemon:@"8080"];

...
- (void)dealloc {
...
  [mongooseDaemon stopMongooseDaemon];
  [mongooseDaemon release];
...
}

And that’s it…an embeded http server with only about 9 lines of code!

TODO

1) Add a helper method to return the server’s URL for convience

2) Add support for some of mongoose’s rich feature set.

3) Investigate if there is anyway to server files over endge/3g instead of just WiFi.

Copyright © 2008 Rama McIntosh Released under the BSD license found in the file LICENSE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.