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

#include <forwarding.hpp>

Classes

struct  Options
 

Public Member Functions

 X11Forwarder (Channel &session_channel, Options options)
 
Result< void > try_request ()
 
Result< std::optional< Channel > > try_accept (std::chrono::milliseconds timeout)
 Blocks up to timeout for the server to open an x11 channel.
 
Result< void > try_run_until_stopped ()
 Accepts then pumps x11 channels to the local display until stop() is called.
 
void stop () noexcept
 

Static Public Member Functions

static Result< ForwardTargettarget_from_display (std::string_view display)
 Parses $DISPLAY (":0", "localhost:10.0", "host:0") into a ForwardTarget.
 

Detailed Description

Client-side X11 forwarding: request it on an open session channel, then accept and pump the (usually single) resulting x11 channel to a local X display. See docs/design/07 ยง7.4. X11 forwarding is a well-known security hazard: a compromised remote host gets access to the local display, so trusted defaults to false and single_connection is recommended.

Constructor & Destructor Documentation

◆ X11Forwarder()

SSHPP_INLINE sshpp::X11Forwarder::X11Forwarder ( Channel session_channel,
Options  options 
)
explicit

Member Function Documentation

◆ try_request()

SSHPP_INLINE Result< void > sshpp::X11Forwarder::try_request ( )

◆ try_accept()

SSHPP_INLINE Result< std::optional< Channel > > sshpp::X11Forwarder::try_accept ( std::chrono::milliseconds  timeout)

Blocks up to timeout for the server to open an x11 channel.

◆ try_run_until_stopped()

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

Accepts then pumps x11 channels to the local display until stop() is called.

◆ stop()

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

◆ target_from_display()

SSHPP_INLINE Result< ForwardTarget > sshpp::X11Forwarder::target_from_display ( std::string_view  display)
static

Parses $DISPLAY (":0", "localhost:10.0", "host:0") into a ForwardTarget.


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