Actix middleware database pool


For example we can use the wrap(pool.clone()) command to add a database pool. I want to set the database according to the proxy header host, but I could not find a way to follow for this. Is it ok to use middleware? If applicable, can you leave a code sample?