simple_web_server.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:sdk-samples 作者: cradlepoint 项目源码 文件源码
def start_server():
    # avoid 8080, as the router may have service on it.
    # Firewall rules will need to be changed in the router
    # to allow access on this port.
    server_address = ('', 9001)

    cs.CSClient().log(APP_NAME, "Starting Server: {}".format(server_address))
    cs.CSClient().log(APP_NAME, "Web Message is: {}".format(WEB_MESSAGE))
    httpd = HTTPServer(server_address, WebServerRequestHandler)

    # Use the line below to serve the index.html page that is in the
    # app directory.
    # httpd = HTTPServer(server_address, SimpleHTTPRequestHandler)

    try:
        httpd.serve_forever()

    except KeyboardInterrupt:
        cs.CSClient().log(APP_NAME, "Stopping Server, Key Board interrupt")

    return 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号