开发者

Can any Haskell web server run Python CGI apps?

开发者 https://www.devze.com 2023-03-31 20:10 出处:网络
I need a web server developed using Haskell to run an old Python CGI开发者_StackOverflow application.

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

Any suggestion is appreciated!


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.

  • http://www.mew.org/~kazu/proj/mighttpd/en/
  • http://hackage.haskell.org/package/mighttpd2
  • http://hackage.haskell.org/package/wai-app-file-cgi


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消