Run a webserver on an iOS device

2019-02-04 21:36发布

I want to create an App that can share files between other iOS devices and potentially also Desktop computers.

So what I want to do is run a lightweight web server on my device that allows to download files from the device like so:

http://myphone.local:1234/folder/samplefile.txt

How can I provide such a server on a non-jailbroken device. I would prefer not to write a server like this from scratch :-).

Thanks a lot for your help

2条回答
啃猪蹄的小仙女
2楼-- · 2019-02-04 22:00
疯言疯语
3楼-- · 2019-02-04 22:10

According to the GitHub project:

CocoaHTTPServer is a small, lightweight, embeddable HTTP server for Mac OS X or iOS applications.

Sometimes developers need an embedded HTTP server in their app. Perhaps it's a server application with remote monitoring. Or perhaps it's a desktop application using HTTP for the communication backend. Or perhaps it's an iOS app providing over-the-air access to documents. Whatever your reason, CocoaHTTPServer can get the job done.

查看更多
登录 后发表回答