Proxy
This module implements proxy-related functionality for streamlit-pyvista. This Proxy is used to allow users to access trame server through a unique gateway, its particularly useful for use of the library in docker containers.
- streamlit_pyvista.proxy.proxy(server_id, path)[source]
Main route of the proxy. This route simply forward the request to and return the result
- Parameters:
server_id – id of the server, it will be looked in the available_servers map
path – Path of the request to make to the server
- Returns:
Response of the target server to the request
- streamlit_pyvista.proxy.find_available_index(candidate_list)[source]
Get the first occurrence of None in a list, if there is no None existing, it extends the list by one and insert a None at this spot
- Parameters:
candidate_list (list[Optional[Any]]) – the list were we want to find a free spot
- Returns:
the first index where None is found, if list doesn’t contain any None, extends it by one
- Return type:
int
- streamlit_pyvista.proxy.update_available_servers()[source]
This route is used by a server manager to update the available_servers map by adding or removing servers
- Returns:
A response containing information about the action taken. If a server was added, add to the response the associated id of the server
- streamlit_pyvista.proxy.forward_client_to_target(ws, target_ws)[source]
This function forward the websocket of the client to the server
- Parameters:
ws – client’s websocket
target_ws – server’s websocket