#[non_exhaustive]pub struct Loopback {
pub address: SocketAddr,
pub proxy_cred: String,
pub local_api_address: SocketAddr,
pub local_api_cred: String,
}Expand description
The result of Server::loopback — the full Go Loopback() (addr, proxyCred, localAPICred, err) surface: both credentials, and an in-process LocalAPI HTTP server actually running.
§Go parity, and the one honest delta
Go serves the SOCKS5 proxy and the LocalAPI on a single muxed loopback listener. This fork
runs two 127.0.0.1 listeners instead — address for the SOCKS5 proxy
(proxy_cred) and local_api_address for the
LocalAPI HTTP server (local_api_cred) — because the SOCKS5 half is the
engine’s own Device::loopback and the LocalAPI half is layered on
top without re-implementing (or first-byte-demuxing) the proven proxy path. The observable
contract is identical: a SOCKS5 proxy gated by proxy_cred, and a LocalAPI gated by
local_api_cred. This delta is surfaced, not faked (see docs/TSNET_FACADE_DESIGN.md §11).
§Lifecycle
Like Go’s s.loopbackListener, both listeners live for the Server’s lifetime and are torn
down by Server::close — Server::loopback is idempotent and returns the same addresses and
credentials on every call. There is no per-result handle to drop.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.address: SocketAddrThe bound 127.0.0.1:<port> address of the SOCKS5 proxy (Go’s addr, SOCKS5 half).
proxy_cred: StringThe SOCKS5 proxy credential (Go’s proxyCred; username is fixed to "tsnet").
local_api_address: SocketAddrThe bound 127.0.0.1:<port> address of the in-process LocalAPI HTTP server.
local_api_cred: StringThe LocalAPI credential (Go’s localAPICred): the HTTP Basic-auth password the LocalAPI
server requires (any username is accepted, matching Go). Reach it with LocalClient.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Loopback
impl RefUnwindSafe for Loopback
impl Send for Loopback
impl Sync for Loopback
impl Unpin for Loopback
impl UnsafeUnpin for Loopback
impl UnwindSafe for Loopback
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<A, T> DynMessage<A> for T
impl<A, T> DynMessage<A> for T
Source§fn handle_dyn<'a>(
self: Box<T>,
state: &'a mut A,
actor_ref: ActorRef<A>,
tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>,
stop: &'a mut bool,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn ReplyError>>> + Send + 'a>>
fn handle_dyn<'a>( self: Box<T>, state: &'a mut A, actor_ref: ActorRef<A>, tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>, stop: &'a mut bool, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn ReplyError>>> + Send + 'a>>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more