国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
Ios HTTP Server

Simple way to embed a http server into your iPhone app

Posted by face on June 15, 2009

Announcing MongooseDaemon, an objective-c wrapper for the wonderful mongoose http server.

It can be indispensable to be able to explore your iPhone appsdirectory structure when developing and debugging iPhone applications.You may also want to serve up content from your iPhone application viahttp.

Erica Sadun’s cookbook has an example of a hand rolled http server.However, it is only an example and is incomplete. I recently needed ahttp server in an iPhone app and after playing with Erica’s example Iquickly realized I didn’t want to be in the business of creating acomplete http server.

So I started looking for an existing http server I could embed in my app. I quickly found moongoose.

With just a few minutes of coding, I was able to get mongooseworking in my iPhone application. To make it even easier for thenext developer, I extracted my wrapper into the MongooseDaemon class andam offering it under a BSD license.

Here is some example code taken directly from one of my apps I am debugging:

Add the following to one of your projects classes .h (MyAppDelegate.h for this example):
1
2
3
4
5
6
7
8
9
  #import "MongooseDaemon.h"
....
@class MongooseDaemon

@interface MyAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
...
MongooseDaemon *mongooseDaemon;
...
}
And add the following to the class ( MyAppDelegate.m for this example):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  ...
@implementation LightyAppDelegate
...
- (void)applicationDidFinishLaunching:(UIApplication *)application {
mongooseDaemon = [[MongooseDaemon alloc] init];
[mongooseDaemon startMongooseDaemon:@"8080"];

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

Now you can surf to your application. For example, if your iPhones IP onwifi is 192.168.1.100 (sorry a helper method for determining your iPhonesIP will be coming soon), then you could surf to http://192.168.1.100:8080/

Serve files in good health!



本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
Principles of good RESTful API Design | Code Planet
RESTful API 設(shè)計(jì)規(guī)范
RedHat7搭建yum源服務(wù)器
Lync Server 2010遷移至Lync Server 2013部署系列 Part6:配置Office Web App 01
如何成為Oracle應(yīng)用程序DBA
Gartner: The top 10 strategic technology trends for 2012
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服