使用 Cocoa 构建 HTTP Web 服务器

发布于 2025-01-03 08:35:14 字数 363 浏览 1 评论 0原文

我正在构建一个应用程序套件,该套件需要在 OS X 上运行的 Web 服务器来接收来自 iOS 设备(或任何支持 Web 的设备)的 HTTP 请求。收到请求后,服务器应用程序将查询 MySQL 数据库,将结果格式化为 XML 并将结果返回给 iOS 应用程序。构建 iOS 应用程序和 OS X 应用程序来查询 MySQL 不是问题,但我不知道如何构建 Web 服务器部分(即让 Cocoa 应用程序侦听传入请求等)。以某种方式使用 Apache 作为 Web 服务器是个好主意吗?如果是这样,我该如何执行此操作(即 Apache 模块、PERL 桥接到 Cocoa)?如果没有,还有哪些替代方案?该应用程序(如果成功)可能会拥有许多用户,因此 Web 服务器必须是安全的(因此是研究 Apache 的原因)。

I am in the process of building an application suite that requires a Web Server to run on OS X to receive HTTP requests from an iOS device (or any web enabled device really). Once a request is received, the server application will then query a MySQL database, format the result into XML and return the result to the iOS application. Building the iOS app and an OS X application to query MySQL is not an issue, but I have no idea how to build the Web Server part (i.e. having a Cocoa application listening for incoming requests etc). Is it a good idea to somehow use Apache as the Web Server? If so how do I do this (i.e. Apache modules, PERL bridging to Cocoa)? If not, what are the alternatives? This application (if successfully) will potentially have many users so the Web Server must be secure (hence the reason of looking into Apache).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁与争疯 2025-01-10 08:35:14

旧线程,但对其他人来说仍然是一个可能的答案: WebAppKit 提供了一种非常易于理解的方法来处理 HTTP 请求和响应。您所描述内容的理想解决方案(据我从您的描述中可以看出)。

Old thread, but nevertheless a possible answer for others: WebAppKit provides an extremely easy-to-understand approach for handling HTTP requests and responses. Ideal solution for what you're describing (as far as I can tell from your description).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文