任何 Haskell Web 服务器都可以运行 Python CGI 应用程序吗?

发布于 2024-12-01 22:02:23 字数 74 浏览 0 评论 0原文

我需要一个使用 Haskell 开发的 Web 服务器来运行旧的 Python CGI 应用程序。

任何建议表示赞赏!

I need a web server developed using Haskell to run an old Python CGI application.

Any suggestion is appreciated!

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

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

发布评论

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

评论(2

桃气十足 2024-12-08 22:02:23

Kazu Yamamoto 编写了 Mighttpd,这是一个构建在 Warp 之上的 Web 服务器,支持运行 CGI 脚本。它可能会做你正在寻找的事情。他还编写了 wai-app-file-cgi,它本质上以库的形式提供 CGI 托管行为(以及静态文件)。

Kazu Yamamoto wrote Mighttpd, a web server built on top of Warp, which has support for running CGI scripts. It will probably do what you're looking for. He also wrote wai-app-file-cgi, which essentially provides the CGI-hosting behavior (as well as static files) as a library.

瞎闹 2024-12-08 22:02:23

我很确定不存在这样的事情。我可以说出几个用 Haskell 编写的 Web 服务器,以及几个使用 Haskell 构建 Web 应用程序的框架,但我刚刚检查了通用 Haskell Web 服务器是否托管 CGI,到目前为止似乎没有一个。

CGI 是一个非常简单的协议。为 Warp 编写插件应该不会 支持它,但似乎没有人这样做。许多 Haskell Web 开发人员似乎正在投资一种名为 WAI 的东西。但 WAI 的工作方式与您要求它执行的操作相反。 WAI 为 Haskell Web 应用程序提供了一种在几乎任何 Web 服务器架构中托管的方式,就像 WSGI 对 Python 所做的那样。

您会注意到,WAI 后端使适当编写的应用程序能够由 CGI 或 FastCGI Web 服务器托管。但这允许 Haskell 运行在 CGI 上,而不是 CGI 运行在 Haskell 上。

在不了解您的情况背后的原因的情况下,我很难想象您真正想要做什么。这有点不寻常,我怀疑这种不寻常就是为什么对于您的特定问题似乎没有任何现有的解决方案。

也许如果您告诉我们更多关于您的需求,我们可以建议替代方法来解决您的问题?

I'm pretty sure there's no such thing. I can name several web servers written in Haskell, and several frameworks to build web applications using Haskell, but I just checked the general purpose Haskell web servers for whether they host CGI, and none of them seem to so far.

CGI is a pretty simple protocol. It shouldn't be too hard to write a plugin for, say, Warp that supports it, but no one seems to have done so. A good number of Haskell web developers seem to be investing in a thing called WAI. But WAI sort of works in the reverse way to what you're asking it to do. WAI gives Haskell web applications a way to be hosted in almost any web server architecture, much like WSGI does for Python.

You'll notice that there are WAI back ends that enable an appropriately written application to be hosted by a CGI or FastCGI web server. But that allows Haskell to run on CGI, not CGI to run on Haskell.

Without knowing more about the reasons behind your scenario, I have trouble imagining what you're really looking to do. It's a little bit unusual, and I suspect that the unusualness is why there doesn't seem to be any existing solutions to your specific problem.

Perhaps if you tell us more about what you're after, we can suggest alternative approaches that will solve your problem?

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