Daemonizing python's BaseHTTPServer

后端 未结 6 1881
南方客
南方客 2021-02-05 20:35

I am working on a daemon where I need to embed a HTTP server. I am attempting to do it with BaseHTTPServer, which when I run it in the foreground, it works fine, but when I tr

6条回答
  •  [愿得一人]
    2021-02-05 21:26

    You start by instantiating a HTTPServer. But you don't actually tell it to start serving in any of the supplied code. In your child process try calling server.serve_forever().

    See this for reference

提交回复
热议问题