浏览代码

Add ProxyServer constructor

Murat Dogan 5 年之前
父节点
当前提交
3e7ee70b7e
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 4 1
      include/rtc/configuration.hpp
  2. 3 0
      src/configuration.cpp

+ 4 - 1
include/rtc/configuration.hpp

@@ -54,9 +54,12 @@ struct IceServer {
 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;
+	uint16_t port;
 	string username;
 	string password;
 };

+ 3 - 0
src/configuration.cpp

@@ -84,4 +84,7 @@ IceServer::IceServer(string hostname_, string service_, string username_, string
     : hostname(std::move(hostname_)), service(std::move(service_)), type(Type::Turn),
       username(std::move(username_)), password(std::move(password_)), relayType(relayType_) {}
 
+ProxyServer::ProxyServer(Type type_, string ip_, uint16_t port_, string username_, string password_)
+    : type(type_), ip(ip_), port(port_), username(username_), password(password_) {}
+
 } // namespace rtc