Skip to content
Snippets Groups Projects
Unverified Commit 221ccbe3 authored by Bensong Liu's avatar Bensong Liu
Browse files

update prot name

parent 8a76a784
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ public:
Forwarder(const rlib::string &inboundConfig, const rlib::string &outboundConfig, const std::list<rlib::string> &filterConfigs) {
if (inboundConfig.starts_with("plain"))
ptrInbound = new Protocols::PlainInbound;
else if (inboundConfig.starts_with("misc"))
else if (inboundConfig.starts_with("dynport"))
ptrInbound = nullptr; // TODO
else
throw std::invalid_argument("Unknown protocol in inboundConfig " + inboundConfig);
......@@ -28,7 +28,7 @@ public:
if (outboundConfig.starts_with("plain"))
ptrOutbound = new Protocols::PlainOutbound;
else if (outboundConfig.starts_with("misc"))
else if (outboundConfig.starts_with("dynport"))
ptrOutbound = nullptr; // TODO
else
throw std::invalid_argument("Unknown protocol in outboundConfig " + outboundConfig);
......
......@@ -10,11 +10,10 @@ namespace Protocols {
public:
virtual loadConfig(string config) override {
auto ar = rlib::string(config).split('@'); // Also works for ipv6.
if (ar.size() != 4)
throw std::invalid_argument("Wrong parameter string for protocol 'misc'. Example: plain@fe00:1e10:ce95:1@1080-3080@MyPassword");
if (ar.size() != 3)
throw std::invalid_argument("Wrong parameter string for protocol 'misc'. Example: plain@fe00:1e10:ce95:1@1080-3080");
listenAddr = ar[1];
// listenPort = ar[2].as<uint16_t>();
psk = ar[3];
// listen these ports.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment