def create_web_server(): server = MicroWebSrv(webPath='www/') server.MaxWebSocketRecvLen = 256 server.WebSocketThreaded = False server.AcceptWebSocketCallback = acceptWebSocketCallback server.Start(threaded=True) return server
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