Monorepo for Tangled tangled.org
5

Configure Feed

Select the types of activity you want to include in your feed.

1use crate::host_proxy::VsockTcpProxy; 2use anyhow::Result; 3 4const DEFAULT_CACHE_READ_PROXY_ADDR: &str = "127.0.0.1:10500"; 5const SHUTTLE_CACHE_READ_PROXY_ADDR_ENV: &str = "SHUTTLE_CACHE_READ_PROXY_ADDR"; 6 7pub struct ReadCacheProxy { 8 inner: VsockTcpProxy, 9} 10 11impl ReadCacheProxy { 12 pub async fn start(host_cid: u32, host_port: u32) -> Result<Option<Self>> { 13 if host_port == 0 { 14 return Ok(None); 15 } 16 17 let addr = std::env::var(SHUTTLE_CACHE_READ_PROXY_ADDR_ENV) 18 .unwrap_or_else(|_| DEFAULT_CACHE_READ_PROXY_ADDR.to_owned()); 19 20 let inner = VsockTcpProxy::start("read cache proxy", &addr, host_cid, host_port).await?; 21 Ok(Some(Self { inner })) 22 } 23 24 pub fn url(&self) -> &str { 25 self.inner.url() 26 } 27}