iOS 设备作为网络服务器 [英] iOS devices as web server

查看:35
本文介绍了iOS 设备作为网络服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到 App Store 上有几个应用程序允许其他计算机与 iPhone/iPad 设备建立 HTTP 连接以传输文件.似乎在 iOS 设备上运行了一个 Web 服务.只是好奇它是如何完成的/使用了什么类?

I saw there are several apps on App Store that allow other computers to make a http connection to the iPhone/iPad devices to transfer files. It seemed like a web service is running on the iOS device. Just curious how is it done /what class was used?

谢谢.

推荐答案

只需要显示设备的 IP 地址,在 iOS 设备上运行的应用程序中打开一个用于侦听的套接字,并实现 http 协议.有几个 3rd 方库可以为您完成大部分繁重的工作:

Just display the devices IP address, open a socket for listening in an app running on the iOS device, and implement the http protocol. There are several 3rd party libraries that can do most of the heavy lifting for you:

CocoaHTTPServer 或 iPhoneHTTPServer3,或 SimpleWebSocketServer,或 MultithreadedHTTPServer3

CocoaHTTPServer or iPhoneHTTPServer3, or SimpleWebSocketServer, or MultithreadedHTTPServer3

这篇关于iOS 设备作为网络服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆