#ifndef RTC_ICE_CONFIGURATION_H
#define RTC_ICE_CONFIGURATION_H
#include "include.hpp"
#include "message.hpp"
#include <vector>
namespace rtc {
struct IceServer {
enum class Type { Stun, Turn };
enum class RelayType { TurnUdp, TurnTcp, TurnTls };
IceServer(const string &url);
IceServer(string hostname_, uint16_t port_);
IceServer(string hostname_, string service_);
IceServer(string hostname_, uint16_t port, string username_, string password_,
RelayType relayType_ = RelayType::TurnUdp);
IceServer(string hostname_, string service_, string username_, string password_,
RelayType relayType_ = RelayType::TurnUdp);
string hostname;
string service;
Type type;
string username;
string password;
RelayType relayType;
};
struct ProxyServer {
enum class Type { None = 0, Socks5, Http, Last = Http };
ProxyServer(Type type_, string ip_, uint16_t port_, string username_ = "",
string password_ = "");
Type type;
string ip;
uint16_t port;
string username;
string password;
};
struct Configuration {
std::vector<IceServer> iceServers;
std::optional<ProxyServer> proxyServer;
bool enableIceTcp = false;
uint16_t portRangeBegin = 1024;
uint16_t portRangeEnd = 65535;
};
}
#endif