Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9af39a5715 | ||
|
|
2f043a6f83 | ||
|
|
d94075e5c3 | ||
|
|
9f1a7c8637 | ||
|
|
2add09ea33 | ||
|
|
8beee5d127 | ||
|
|
84bb675b9c | ||
|
|
67c43de80d | ||
|
|
ab4580920f | ||
|
|
c0942c4015 |
No files matched your search
@@ -15,16 +15,25 @@ permissions:
|
||||
|
||||
env:
|
||||
PACKAGE_VERSION: 0.1.${{ github.run_number }}
|
||||
PACKAGE_FILE: nipovpn_dev_0.1.${{ github.run_number }}_amd64.deb
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: amd64
|
||||
- arch: arm64
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: arm64
|
||||
|
||||
- name: Set up dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
@@ -42,55 +51,97 @@ jobs:
|
||||
- name: Build binary
|
||||
run: |
|
||||
rm -rf build
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
|
||||
if [ "${{ matrix.arch }}" = "arm64" ]; then
|
||||
docker run --rm --platform linux/arm64 \
|
||||
-v "$PWD:/src" \
|
||||
-w /src \
|
||||
ubuntu:24.04 \
|
||||
bash -c '
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
apt-get update
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
libssl-dev \
|
||||
libboost-all-dev \
|
||||
libyaml-cpp-dev
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
'
|
||||
|
||||
sudo chown -R $USER:$USER build
|
||||
|
||||
else
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
fi
|
||||
|
||||
- name: Build Debian package
|
||||
run: |
|
||||
PACKAGE_FILE="nipovpn_dev_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
|
||||
|
||||
mkdir -p nipovpn/usr/bin
|
||||
|
||||
cp build/core/nipovpn nipovpn/usr/bin/nipovpn
|
||||
chmod 755 nipovpn/usr/bin/nipovpn
|
||||
|
||||
sed -i -E "s/^Version[[:space:]]*:.*/Version: ${PACKAGE_VERSION}/" nipovpn/DEBIAN/control
|
||||
sed -i -E "s/^Architecture[[:space:]]*:.*/Architecture: ${{ matrix.arch }}/" nipovpn/DEBIAN/control
|
||||
|
||||
echo "Final control file:"
|
||||
cat nipovpn/DEBIAN/control
|
||||
|
||||
grep "^Version: ${PACKAGE_VERSION}$" nipovpn/DEBIAN/control
|
||||
grep "^Architecture: ${{ matrix.arch }}$" nipovpn/DEBIAN/control
|
||||
|
||||
mkdir -p build
|
||||
chmod 755 build
|
||||
|
||||
dpkg-deb --build nipovpn "build/${PACKAGE_FILE}"
|
||||
|
||||
ls -lah build/
|
||||
|
||||
- name: Show package information
|
||||
run: |
|
||||
PACKAGE_FILE="nipovpn_dev_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
|
||||
dpkg -I "build/${PACKAGE_FILE}"
|
||||
dpkg -c "build/${PACKAGE_FILE}"
|
||||
|
||||
- name: Upload Debian package as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: nipovpn-dev-deb
|
||||
path: build/${{ env.PACKAGE_FILE }}
|
||||
name: nipovpn-dev-deb-${{ matrix.arch }}
|
||||
path: build/nipovpn_dev_${{ env.PACKAGE_VERSION }}_${{ matrix.arch }}.deb
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Download Debian package artifact
|
||||
- name: Download Debian package artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nipovpn-dev-deb
|
||||
pattern: nipovpn-dev-deb-*
|
||||
merge-multiple: true
|
||||
path: ./
|
||||
|
||||
- name: Create DEV GitHub Release
|
||||
- name: Create Dev GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: dev-v${{ env.PACKAGE_VERSION }}
|
||||
name: DEV Version v${{ env.PACKAGE_VERSION }}
|
||||
name: Dev Version v${{ env.PACKAGE_VERSION }}
|
||||
prerelease: true
|
||||
files: ${{ env.PACKAGE_FILE }}
|
||||
files: |
|
||||
nipovpn_dev_${{ env.PACKAGE_VERSION }}_amd64.deb
|
||||
nipovpn_dev_${{ env.PACKAGE_VERSION }}_arm64.deb
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
@@ -15,16 +15,25 @@ permissions:
|
||||
|
||||
env:
|
||||
PACKAGE_VERSION: 0.2.${{ github.run_number }}
|
||||
PACKAGE_FILE: nipovpn_mori_0.2.${{ github.run_number }}_amd64.deb
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: amd64
|
||||
- arch: arm64
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: arm64
|
||||
|
||||
- name: Set up dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
@@ -42,47 +51,87 @@ jobs:
|
||||
- name: Build binary
|
||||
run: |
|
||||
rm -rf build
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
|
||||
if [ "${{ matrix.arch }}" = "arm64" ]; then
|
||||
docker run --rm --platform linux/arm64 \
|
||||
-v "$PWD:/src" \
|
||||
-w /src \
|
||||
ubuntu:24.04 \
|
||||
bash -c '
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
apt-get update
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
libssl-dev \
|
||||
libboost-all-dev \
|
||||
libyaml-cpp-dev
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
'
|
||||
|
||||
sudo chown -R $USER:$USER build
|
||||
|
||||
else
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
fi
|
||||
|
||||
- name: Build Debian package
|
||||
run: |
|
||||
PACKAGE_FILE="nipovpn_mori_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
|
||||
|
||||
mkdir -p nipovpn/usr/bin
|
||||
|
||||
cp build/core/nipovpn nipovpn/usr/bin/nipovpn
|
||||
chmod 755 nipovpn/usr/bin/nipovpn
|
||||
|
||||
sed -i -E "s/^Version[[:space:]]*:.*/Version: ${PACKAGE_VERSION}/" nipovpn/DEBIAN/control
|
||||
sed -i -E "s/^Architecture[[:space:]]*:.*/Architecture: ${{ matrix.arch }}/" nipovpn/DEBIAN/control
|
||||
|
||||
echo "Final control file:"
|
||||
cat nipovpn/DEBIAN/control
|
||||
|
||||
grep "^Version: ${PACKAGE_VERSION}$" nipovpn/DEBIAN/control
|
||||
grep "^Architecture: ${{ matrix.arch }}$" nipovpn/DEBIAN/control
|
||||
|
||||
mkdir -p build
|
||||
chmod 755 build
|
||||
|
||||
dpkg-deb --build nipovpn "build/${PACKAGE_FILE}"
|
||||
|
||||
ls -lah build/
|
||||
|
||||
- name: Show package information
|
||||
run: |
|
||||
PACKAGE_FILE="nipovpn_mori_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
|
||||
dpkg -I "build/${PACKAGE_FILE}"
|
||||
dpkg -c "build/${PACKAGE_FILE}"
|
||||
|
||||
- name: Upload Debian package as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: nipovpn-mori-deb
|
||||
path: build/${{ env.PACKAGE_FILE }}
|
||||
name: nipovpn-mori-deb-${{ matrix.arch }}
|
||||
path: build/nipovpn_mori_${{ env.PACKAGE_VERSION }}_${{ matrix.arch }}.deb
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Download Debian package artifact
|
||||
- name: Download Debian package artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nipovpn-mori-deb
|
||||
pattern: nipovpn-mori-deb-*
|
||||
merge-multiple: true
|
||||
path: ./
|
||||
|
||||
- name: Create MORI GitHub Release
|
||||
@@ -91,6 +140,8 @@ jobs:
|
||||
tag_name: mori-v${{ env.PACKAGE_VERSION }}
|
||||
name: MORI Version v${{ env.PACKAGE_VERSION }}
|
||||
prerelease: true
|
||||
files: ${{ env.PACKAGE_FILE }}
|
||||
files: |
|
||||
nipovpn_mori_${{ env.PACKAGE_VERSION }}_amd64.deb
|
||||
nipovpn_mori_${{ env.PACKAGE_VERSION }}_arm64.deb
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
@@ -15,16 +15,25 @@ permissions:
|
||||
|
||||
env:
|
||||
PACKAGE_VERSION: 1.1.${{ github.run_number }}
|
||||
PACKAGE_FILE: nipovpn_1.1.${{ github.run_number }}_amd64.deb
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: amd64
|
||||
- arch: arm64
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: arm64
|
||||
|
||||
- name: Set up dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
@@ -42,59 +51,97 @@ jobs:
|
||||
- name: Build binary
|
||||
run: |
|
||||
rm -rf build
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
|
||||
if [ "${{ matrix.arch }}" = "arm64" ]; then
|
||||
docker run --rm --platform linux/arm64 \
|
||||
-v "$PWD:/src" \
|
||||
-w /src \
|
||||
ubuntu:24.04 \
|
||||
bash -c '
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
apt-get update
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
libssl-dev \
|
||||
libboost-all-dev \
|
||||
libyaml-cpp-dev
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
'
|
||||
|
||||
sudo chown -R $USER:$USER build
|
||||
|
||||
else
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
fi
|
||||
|
||||
- name: Build Debian package
|
||||
run: |
|
||||
PACKAGE_FILE="nipovpn_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
|
||||
|
||||
mkdir -p nipovpn/usr/bin
|
||||
|
||||
cp build/core/nipovpn nipovpn/usr/bin/nipovpn
|
||||
chmod 755 nipovpn/usr/bin/nipovpn
|
||||
|
||||
sed -i -E "s/^Version[[:space:]]*:.*/Version: ${PACKAGE_VERSION}/" nipovpn/DEBIAN/control
|
||||
sed -i -E "s/^Architecture[[:space:]]*:.*/Architecture: ${{ matrix.arch }}/" nipovpn/DEBIAN/control
|
||||
|
||||
echo "Final control file:"
|
||||
cat nipovpn/DEBIAN/control
|
||||
|
||||
grep "^Version: ${PACKAGE_VERSION}$" nipovpn/DEBIAN/control
|
||||
grep "^Architecture: ${{ matrix.arch }}$" nipovpn/DEBIAN/control
|
||||
|
||||
mkdir -p build
|
||||
chmod 755 build
|
||||
|
||||
dpkg-deb --build nipovpn "build/${PACKAGE_FILE}"
|
||||
|
||||
ls -lah build/
|
||||
|
||||
- name: Show package information
|
||||
run: |
|
||||
PACKAGE_FILE="nipovpn_${PACKAGE_VERSION}_${{ matrix.arch }}.deb"
|
||||
dpkg -I "build/${PACKAGE_FILE}"
|
||||
dpkg -c "build/${PACKAGE_FILE}"
|
||||
|
||||
- name: Upload Debian package as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: nipovpn-main-deb
|
||||
path: build/${{ env.PACKAGE_FILE }}
|
||||
name: nipovpn-deb-${{ matrix.arch }}
|
||||
path: build/nipovpn_${{ env.PACKAGE_VERSION }}_${{ matrix.arch }}.deb
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Download Debian package artifact
|
||||
- name: Download Debian package artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nipovpn-main-deb
|
||||
pattern: nipovpn-deb-*
|
||||
merge-multiple: true
|
||||
path: ./
|
||||
|
||||
- name: Check downloaded files
|
||||
run: |
|
||||
ls -lah
|
||||
|
||||
- name: Create MAIN GitHub Release
|
||||
- name: Create Main GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: v${{ env.PACKAGE_VERSION }}
|
||||
name: Version v${{ env.PACKAGE_VERSION }}
|
||||
prerelease: false
|
||||
files: ${{ env.PACKAGE_FILE }}
|
||||
prerelease: true
|
||||
files: |
|
||||
nipovpn_${{ env.PACKAGE_VERSION }}_amd64.deb
|
||||
nipovpn_${{ env.PACKAGE_VERSION }}_arm64.deb
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
@@ -149,7 +149,7 @@ void AgentHandler::handle() {
|
||||
}
|
||||
|
||||
std::string AgentHandler::relayHostHeader(const std::shared_ptr<Config> &config) {
|
||||
std::string hostHeader = config->general().fakeUrl;
|
||||
std::string hostHeader = config->randomFakeUrl();
|
||||
auto pos = hostHeader.find("://");
|
||||
if (pos != std::string::npos) hostHeader = hostHeader.substr(pos + 3);
|
||||
pos = hostHeader.find('/');
|
||||
|
||||
+32
-4
@@ -9,10 +9,11 @@ Config::Config(const RunMode &mode, const std::string &filePath)
|
||||
listenIp_("127.0.0.1"),
|
||||
listenPort_(0),
|
||||
general_({configYaml_["general"]["token"].as<std::string>(),
|
||||
configYaml_["general"]["fakeUrl"].as<std::string>(),
|
||||
configYaml_["general"]["fakeUrls"].as<std::vector<std::string>>(),
|
||||
configYaml_["general"]["methods"].as<std::vector<std::string>>(),
|
||||
configYaml_["general"]["endPoints"].as<std::vector<std::string>>(),
|
||||
configYaml_["general"]["timeout"].as<unsigned short>(),
|
||||
configYaml_["general"]["pullTimeout"].as<unsigned short>(),
|
||||
configYaml_["general"]["tunnelEnable"].as<bool>(false),
|
||||
configYaml_["general"]["connectionReuse"].as<bool>(false),
|
||||
configYaml_["general"]["tlsEnable"].as<bool>(false),
|
||||
@@ -72,7 +73,17 @@ std::string Config::toString() const {
|
||||
ss << "\nConfig :\n"
|
||||
<< " General :\n"
|
||||
<< " token: " << general_.token << "\n"
|
||||
<< " fakeUrl: " << general_.fakeUrl << "\n"
|
||||
<< " fakeUrls: ";
|
||||
|
||||
for (std::size_t i = 0; i < general_.fakeUrls.size(); ++i) {
|
||||
ss << general_.fakeUrls[i];
|
||||
|
||||
if (i != general_.fakeUrls.size() - 1) {
|
||||
ss << ", ";
|
||||
}
|
||||
}
|
||||
|
||||
ss << "\n"
|
||||
<< " methods: ";
|
||||
|
||||
for (std::size_t i = 0; i < general_.methods.size(); ++i) {
|
||||
@@ -96,6 +107,7 @@ std::string Config::toString() const {
|
||||
|
||||
ss << "\n"
|
||||
<< " timeout: " << general_.timeout << "\n"
|
||||
<< " pullTimeout: " << general_.pullTimeout << "\n"
|
||||
<< " tunnelEnable: " << std::boolalpha << general_.tunnelEnable << "\n"
|
||||
<< " connectionReuse: " << std::boolalpha << general_.connectionReuse << "\n"
|
||||
<< " tlsEnable: " << std::boolalpha << general_.tlsEnable << "\n"
|
||||
@@ -198,11 +210,27 @@ std::string Config::modeToString() const {
|
||||
}
|
||||
}
|
||||
|
||||
std::string Config::randomFakeUrl() const {
|
||||
std::lock_guard<std::mutex> lock(configMutex_);
|
||||
|
||||
if (general_.fakeUrls.empty()) {
|
||||
return "www.google.com";
|
||||
}
|
||||
|
||||
static thread_local std::mt19937 generator{std::random_device{}()};
|
||||
|
||||
std::uniform_int_distribution<std::size_t> distribution(
|
||||
0,
|
||||
general_.fakeUrls.size() - 1);
|
||||
|
||||
return general_.fakeUrls[distribution(generator)];
|
||||
}
|
||||
|
||||
std::string Config::randomMethod() const {
|
||||
std::lock_guard<std::mutex> lock(configMutex_);
|
||||
|
||||
if (general_.methods.empty()) {
|
||||
return "GET";// fallback
|
||||
return "GET";
|
||||
}
|
||||
|
||||
static thread_local std::mt19937 generator{std::random_device{}()};
|
||||
@@ -218,7 +246,7 @@ std::string Config::randomEndPoint() const {
|
||||
std::lock_guard<std::mutex> lock(configMutex_);
|
||||
|
||||
if (general_.endPoints.empty()) {
|
||||
return "api";// fallback
|
||||
return "api";
|
||||
}
|
||||
|
||||
static thread_local std::mt19937 generator{std::random_device{}()};
|
||||
|
||||
+4
-1
@@ -20,10 +20,11 @@ class Config : private Uncopyable {
|
||||
private:
|
||||
struct General {
|
||||
std::string token;
|
||||
std::string fakeUrl;
|
||||
std::vector<std::string> fakeUrls;
|
||||
std::vector<std::string> methods;
|
||||
std::vector<std::string> endPoints;
|
||||
unsigned short timeout;
|
||||
unsigned short pullTimeout;
|
||||
bool tunnelEnable;
|
||||
bool connectionReuse;
|
||||
bool tlsEnable;
|
||||
@@ -107,6 +108,8 @@ public:
|
||||
|
||||
std::string toString() const;
|
||||
|
||||
std::string randomFakeUrl() const;
|
||||
|
||||
std::string randomMethod() const;
|
||||
|
||||
std::string randomEndPoint() const;
|
||||
|
||||
@@ -325,10 +325,11 @@ inline BoolStr validateConfig(int argc, const char *argv[]) {
|
||||
|
||||
try {
|
||||
configYaml["general"]["token"].as<std::string>();
|
||||
configYaml["general"]["fakeUrl"].as<std::string>();
|
||||
configYaml["general"]["fakeUrls"].as<std::vector<std::string>>();
|
||||
configYaml["general"]["methods"].as<std::vector<std::string>>();
|
||||
configYaml["general"]["endPoints"].as<std::vector<std::string>>();
|
||||
configYaml["general"]["timeout"].as<unsigned short>();
|
||||
configYaml["general"]["pullTimeout"].as<unsigned short>();
|
||||
configYaml["general"]["tunnelEnable"].as<bool>();
|
||||
} catch (const std::exception &e) {
|
||||
result.message = std::string("Error in 'general' block: ") + e.what() + "\n";
|
||||
|
||||
+6
-4
@@ -156,10 +156,11 @@ bool HTTP::parseTls() {
|
||||
}
|
||||
|
||||
const std::string HTTP::genHttpPostReqString(const std::string &body) const {
|
||||
auto fakeUrl = config_->randomFakeUrl();
|
||||
return std::string(config_->randomMethod() + " " +
|
||||
config_->general().fakeUrl + " HTTP/" +
|
||||
fakeUrl + " HTTP/" +
|
||||
config_->agent().httpVersion + "\r\n") +
|
||||
"Host: " + config_->general().fakeUrl + "\r\n" +
|
||||
"Host: " + fakeUrl + "\r\n" +
|
||||
"User-Agent: " + config_->agent().userAgent + "\r\n" +
|
||||
"Accept: */*\r\n" + "Connection: keep-alive\r\n" +
|
||||
"Content-Length: " + std::to_string(body.length()) + "\r\n" +
|
||||
@@ -167,10 +168,11 @@ const std::string HTTP::genHttpPostReqString(const std::string &body) const {
|
||||
}
|
||||
|
||||
const std::string HTTP::genHttpRestPostReqString() const {
|
||||
auto fakeUrl = config_->randomFakeUrl();
|
||||
return std::string(config_->randomMethod() + " " +
|
||||
config_->general().fakeUrl + " HTTP/" +
|
||||
fakeUrl + " HTTP/" +
|
||||
config_->agent().httpVersion + "\r\n") +
|
||||
"Host: " + config_->general().fakeUrl + "\r\n" +
|
||||
"Host: " + fakeUrl + "\r\n" +
|
||||
"User-Agent: " + config_->agent().userAgent + "\r\n" +
|
||||
"Accept: */*\r\n" + "Connection: keep-alive\r\n" +
|
||||
"Rest: yes\r\n" + "COMP\r\n\r\n";
|
||||
|
||||
@@ -160,7 +160,7 @@ bool TCPClient::doHandshakeClient() {
|
||||
try {
|
||||
if (!tlsEnabled_ || !sslSocket_) return true;
|
||||
|
||||
std::string sniHost = config_->general().fakeUrl;
|
||||
std::string sniHost = config_->randomFakeUrl();
|
||||
|
||||
if (!sniHost.empty()) {
|
||||
auto pos = sniHost.find("://");
|
||||
|
||||
@@ -390,7 +390,7 @@ void TCPConnection::handleReadServer(const boost::system::error_code &error, siz
|
||||
}
|
||||
|
||||
std::string TCPConnection::makeRelayHostHeader() const {
|
||||
std::string hostHeader = config_->general().fakeUrl;
|
||||
std::string hostHeader = config_->randomFakeUrl();
|
||||
|
||||
auto pos = hostHeader.find("://");
|
||||
if (pos != std::string::npos) hostHeader = hostHeader.substr(pos + 3);
|
||||
@@ -512,7 +512,7 @@ void TCPConnection::startTunnelPollServer() {
|
||||
|
||||
pollInProgress_ = true;
|
||||
|
||||
pollTimer_.expires_after(std::chrono::milliseconds(10));
|
||||
pollTimer_.expires_after(std::chrono::milliseconds(config_->general().pullTimeout));
|
||||
pollTimer_.async_wait(
|
||||
boost::asio::bind_executor(
|
||||
strand_,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Package : nipovpn
|
||||
Version : 0.1
|
||||
Maintainer : Morteza Bashsiz
|
||||
Architecture : amd64
|
||||
Description : Powerfull and Secure http/s Proxy
|
||||
Depends : libyaml-cpp0.8
|
||||
Homepage : https://github.com/MortezaBashsiz/nipovpn
|
||||
Package: nipovpn
|
||||
Version: ${PACKAGE_VERSION}
|
||||
Maintainer: Morteza Bashsiz
|
||||
Architecture: ${{ matrix.arch }}
|
||||
Description: Powerfull and Secure http/s Proxy
|
||||
Depends: libyaml-cpp0.8
|
||||
Homepage: https://github.com/MortezaBashsiz/nipovpn
|
||||
@@ -3,15 +3,19 @@
|
||||
general:
|
||||
# token: 32 bytes of string. this will be used on agent and server side to encryption
|
||||
token: "af445adb-2434-4975-9445-2c1b2231"
|
||||
# fakeUrl: string
|
||||
# Defines the fake url between agent and server
|
||||
fakeUrl: "www.google.com"
|
||||
# fakeUrls:
|
||||
# Defines the list of fake urls between agent and server
|
||||
fakeUrls:
|
||||
- nipo.ciron.net
|
||||
- sudoer.ir
|
||||
- sudoer.net
|
||||
- google.com
|
||||
- cloudflare.com
|
||||
# methods:
|
||||
# Defines the list of using methods
|
||||
# you like to send requests from agent to server
|
||||
# Program will choose randomly from this list
|
||||
methods:
|
||||
- HEAD
|
||||
- GET
|
||||
- POST
|
||||
- PUT
|
||||
@@ -29,6 +33,10 @@ general:
|
||||
# Defines the timeout for I/O Operation in seconds. 0 indicates no timeout.
|
||||
# Useful to automatically close stalled connections.
|
||||
timeout: 10
|
||||
# pullTimeout: unsigned short
|
||||
# Defines the timeout for I/O Operation in milliseconds.
|
||||
# Useful to expire serverside read timer.
|
||||
pullTimeout: 50
|
||||
# tunnelEnable: bool
|
||||
# Defines the connection mode between agent and server. If enabled then the traffic
|
||||
# will be TCP/TLS tunnel like.
|
||||
@@ -36,7 +44,7 @@ general:
|
||||
# connectionReuse: bool
|
||||
# If false then it will use same connection between agent and server to handle client request
|
||||
# If true then it will create new connection for each request between agent and server
|
||||
connectionReuse: false
|
||||
connectionReuse: true
|
||||
# tlsEnable: bool
|
||||
# It enables or disables tls between agent and server
|
||||
tlsEnable: false
|
||||
@@ -76,7 +84,7 @@ agent:
|
||||
# listenPort: the port number which will be used on agent
|
||||
listenPort: 8080
|
||||
# serverIp: IPv4 of the nipoServer
|
||||
serverIp: "127.0.0.1"
|
||||
serverIp: "127.0.0.10"
|
||||
# serverPort: port number of the nipoServer
|
||||
serverPort: 80
|
||||
# httpVersion: This version will be used between agent and server
|
||||
|
||||
Reference in new issue
Block a user