libsshpp v0.1.7
Modern C++17 wrapper for libssh
Loading...
Searching...
No Matches
sshpp::SocksProxy Class Reference

#include <forwarding.hpp>

Classes

struct  Options
 

Public Member Functions

 SocksProxy (Session &, Options)
 
 ~SocksProxy ()
 
 SocksProxy (const SocksProxy &)=delete
 
SocksProxyoperator= (const SocksProxy &)=delete
 
Result< void > try_start ()
 
Result< void > try_run_until_stopped ()
 
void stop () noexcept
 
bool running () const noexcept
 
TcpEndpoint local_endpoint () const noexcept
 
ForwardStats stats () const noexcept
 

Detailed Description

Dynamic forwarding (ssh -D): a minimal local SOCKS4/5 proxy tunnelling CONNECT requests over direct-tcpip channels. libssh has no SOCKS support; this is ours. See docs/design/07 ยง7.6.

Hardening: SOCKS5 only by default (allow_socks4 opts in), no auth method advertised other than "no auth" (the listener is loopback-only by default), hostnames are forwarded to the SSH server rather than resolved locally (matches ssh -D, avoids local DNS leaks), strict length checks on every field of the request, and a hard cap on in-flight connections.

Constructor & Destructor Documentation

◆ SocksProxy() [1/2]

SSHPP_INLINE sshpp::SocksProxy::SocksProxy ( Session session,
Options  opts 
)

◆ ~SocksProxy()

SSHPP_INLINE sshpp::SocksProxy::~SocksProxy ( )

◆ SocksProxy() [2/2]

sshpp::SocksProxy::SocksProxy ( const SocksProxy )
delete

Member Function Documentation

◆ operator=()

SocksProxy & sshpp::SocksProxy::operator= ( const SocksProxy )
delete

◆ try_start()

SSHPP_INLINE Result< void > sshpp::SocksProxy::try_start ( )

◆ try_run_until_stopped()

SSHPP_INLINE Result< void > sshpp::SocksProxy::try_run_until_stopped ( )

◆ stop()

SSHPP_INLINE void sshpp::SocksProxy::stop ( )
noexcept

◆ running()

bool sshpp::SocksProxy::running ( ) const
inlinenoexcept

◆ local_endpoint()

TcpEndpoint sshpp::SocksProxy::local_endpoint ( ) const
inlinenoexcept

◆ stats()

SSHPP_INLINE ForwardStats sshpp::SocksProxy::stats ( ) const
noexcept

The documentation for this class was generated from the following files: