MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / startWstunnel

Function startWstunnel

src/helper/linux/process_command.cpp:396–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396std::string startWstunnel(const std::string &pars)
397{
398 std::string hostname;
399 unsigned int port, localPort;
400 deserializePars(pars, hostname, port, localPort);
401
402 spdlog::debug("Starting wstunnel");
403
404 if (!Validation::isValidIpv4Address(hostname)) {
405 return serializeResult(false);
406 }
407
408 std::string wstunnelPath;
409 if (!Utils::resolveExePath(Utils::getExePath(), WS_PRODUCT_NAME_LOWER "wstunnel", wstunnelPath)) {
410 return serializeResult(false);
411 }
412
413 std::vector<std::string> args = {
414 "--listenAddress", "127.0.0.1:" + std::to_string(localPort),
415 "--remoteAddress", "wss://" + hostname + ":" + std::to_string(port) + "/tcp/127.0.0.1/1194",
416 "--logFilePath", "",
417 };
418
419 Spawn::Options opts;
420 opts.runAsUser = WS_PRODUCT_NAME_LOWER;
421 return serializeResult(Spawn::spawnDetached(wstunnelPath, args, opts));
422}
423
424std::string setMacAddress(const std::string &pars)
425{

Callers

nothing calls this directly

Calls 7

deserializeParsFunction · 0.85
isValidIpv4AddressFunction · 0.85
serializeResultFunction · 0.85
to_stringFunction · 0.85
spawnDetachedFunction · 0.85
resolveExePathFunction · 0.70
getExePathFunction · 0.70

Tested by

no test coverage detected