blob: 64a488817f9659ccf67ff0b90b55c1af6d4a6f5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include "socks5.hpp"
#include <boost/asio/io_context.hpp>
#include <thread>
int main() {
boost::asio::io_context ioc;
auto server = SOCKS5::ProxyServer(ioc, "127.0.0.1", 1080);
auto threads = std::vector<std::thread>();
server.start();
for (size_t i = 0; i < 4; ++i) {
threads.emplace_back([&ioc]() { ioc.run(); });
}
for (size_t i = 0; i < threads.size(); ++i) {
threads[i].join();
}
}
|