Skip to content

About

C++ SDK for secure outbound-only rstream tunnels and private connectivity.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

258 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rstream C++ SDK

rstream lets an application publish a service or reach a private service through an outbound connection. The C++ SDK embeds that connection in native services, gateways and devices. It provides Boost.Asio sockets and acceptors that work with Boost.Beast, with the event loop and resource ownership in the application.

Task Start here
Run a first application with the published SDK Build an application.
Add a tunnel to an existing Asio or Beast application Integrate HTTP, TLS or WebSocket with Beast.
Compile and test this checkout Build from source.
Evaluate runtimes, deployment and protocol coverage Choose an SDK and see Editions and plans.

Serve HTTP with Boost.Beast

The application creates a published HTTP/1.1 tunnel from an Asio coroutine. The Engine returns the address to open in a browser.

co_await client.async_connect(asio::use_awaitable);
rstrm::tunnel_properties properties{};
properties.m_protocol = rstrm::protocol::http;
properties.m_http_version = "http/1.1";
properties.m_publish = true;
auto tunnel = co_await client.async_create_tunnel(properties, asio::use_awaitable);
std::cout << rstrm::format_forwarding_address(tunnel.properties()).value() << std::endl;

For each socket accepted by the tunnel, the Beast handler reads the request and returns Hello from rstream.

asio::awaitable<void> respond(rstrm::socket& socket)
{
  boost::beast::flat_buffer buffer;
  http::request<http::string_body> request;
  co_await http::async_read(socket, buffer, request, asio::use_awaitable);

  http::response<http::string_body> response{http::status::ok, request.version()};
  response.set(http::field::content_type, "text/plain");
  response.keep_alive(false);
  response.body() = "Hello from rstream";
  response.prepare_payload();
  co_await http::async_write(socket, response, asio::use_awaitable);
}

Build and run the complete server with Conan and CMake. For an existing Beast service, the listener migration uses the same handler with TCP and rstream sockets.

Documentation

The guide index leads from the first connection to tunnel patterns, native runtime options and deployment. The SDK requires C++20 and uses TLS to carry bytestream tunnels. The native utilities are distributed separately as rstream-utils.

Security and support

Report vulnerabilities through Security. Use GitHub issues for reproducible bugs and usage questions. See Contributing for development practices. The SDK is licensed under Apache-2.0.

About

C++ SDK for secure outbound-only rstream tunnels and private connectivity.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages