コード例 #1
0
def create_web_server():
    server = MicroWebSrv(webPath='www/')
    server.MaxWebSocketRecvLen = 256
    server.WebSocketThreaded = False
    server.AcceptWebSocketCallback = acceptWebSocketCallback
    server.Start(threaded=True)
    return server
コード例 #2
0
def create_web_server(https=False):
    if https:
        server = MicroWebSrv(webPath='www/',
                             port=8443,
                             sslOptions={
                                 'key': mykey,
                                 'cert': mycert
                             })
    else:
        server = MicroWebSrv(webPath='www/')
    server.MaxWebSocketRecvLen = 256
    server.WebSocketThreaded = False
    server.AcceptWebSocketCallback = acceptWebSocketCallback
    server.Start(threaded=True)
    return server