Back to Site
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1#pragma once
2
8#include "librats/util/rats_export.h"
9#include "librats/core/types.h" // TransportKind
10
11#include <cstdint>
12#include <string>
13
14namespace librats {
15
16struct RATS_API NodeConfig {
20 uint16_t listen_port = 0;
21 bool enable_listen = true;
22
23 // ── Transports ──────────────────────────────────────────────────────────
24 //
25 // TCP and UDP are equal citizens here: identical framing, identical Noise
26 // handshake, identical guarantees. They differ only in how the ordered,
27 // reliable byte stream underneath is obtained — the kernel's TCP stack, or
28 // the library's own reliability layer over datagrams (transport/udp_stream.h).
29 // A node normally offers both and lets each dial pick.
30
32 bool enable_tcp = true;
36 bool enable_udp = true;
37
47 TransportKind preferred_transport = TransportKind::Udp;
48
53 uint32_t transport_fallback_ms = 1200;
54
71 size_t send_queue_limit = 0;
72
81 std::string bind_address = "";
82
85 size_t reactor_threads = 1;
86
91 size_t max_peers = 0;
92
94 enum class Security { Noise, Plaintext };
95 Security security = Security::Noise;
96
103 std::string protocol = "librats/1.0";
104
108 std::string data_dir = "";
109
114 bool enable_network_monitor = true;
115};
116
117} // namespace librats
Definition node.h:73
Security
Secure channel to use for peer connections.
Definition config.h:94