76#include "librats/util/rats_export.h"
81#include "librats/transport/relay_link.h"
85#include <condition_variable>
99 bool enable_client =
true;
104 size_t max_probes = 3;
108 size_t max_outbound_circuits = 8;
113 std::chrono::milliseconds open_timeout{8000};
117 std::chrono::milliseconds cooldown{60000};
123 bool accept_inbound =
true;
126 size_t max_inbound_circuits = 16;
136 size_t max_circuits = 32;
140 size_t max_circuits_per_peer = 2;
145 uint64_t max_bytes_per_circuit = 64ull * 1024 * 1024;
148 std::chrono::seconds max_circuit_duration{600};
151 size_t request_budget = 8;
152 std::chrono::milliseconds request_window{1000};
159 uint32_t window = Circuit::kDefaultWindow;
164 bool upgrade_with_hole_punch =
true;
167 std::chrono::milliseconds tick{250};
198 std::shared_ptr<State> state_;
204 std::atomic<bool> running_{
false};
205 std::mutex worker_mutex_;
206 std::condition_variable worker_cv_;
size_t carried_circuits() const
Circuits this node is carrying on behalf of other peers.
size_t attempts() const
Attempts to reach a peer through a relay that are currently running.
bool connect_via_relay(const PeerId &target) override
Try to reach target through a node both ends are connected to.
uint64_t carried_bytes() const
Bytes forwarded on behalf of other peers.
size_t circuits() const
Circuits this node terminates (relayed peers, live or still being set up).
void attach(NodeContext &ctx) override
A pluggable network subsystem.
Self-certifying peer identity.
The narrow contract a subsystem needs from the node — and nothing more.
Capability that lets a sibling module ask for a peer to be reached through a third node,...
Interface-keyed service lookup for targeted, synchronous module calls.