From 8e59587b9fcf4f80d31e7aee77f378122d488a3a Mon Sep 17 00:00:00 2001 From: RadKesvat Date: Fri, 22 Dec 2023 23:32:00 +0330 Subject: [PATCH] 7.1 --- config.nims | 4 ++-- scripts/install.sh | 12 ++++++------ src/foreign_server.nim | 28 +++++++++++++--------------- src/globals.nim | 4 ++-- 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/config.nims b/config.nims index ffacbee..84e57b6 100644 --- a/config.nims +++ b/config.nims @@ -71,8 +71,8 @@ task build_server, "builds server": switch("passL", " -s") switch("debuginfo", "off") switch("passC", "-DNDEBUG") - # switch("passC", "-flto") - # switch("passL", "-flto") + switch("passC", "-flto") + switch("passL", "-flto") switch("obj_checks","off") switch("field_checks","off") diff --git a/scripts/install.sh b/scripts/install.sh index e25d226..882a12f 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -52,19 +52,19 @@ printf "\n" case $(uname -m) in - x86_64) URL="https://github.com/radkesvat/ReverseTlsTunnel/releases/download/V6.9/v6.9_linux_amd64.zip" ;; - arm) URL="https://github.com/radkesvat/ReverseTlsTunnel/releases/download/V6.9/v6.9_linux_arm64.zip" ;; - aarch64) URL="https://github.com/radkesvat/ReverseTlsTunnel/releases/download/V6.9/v6.9_linux_arm64.zip" ;; + x86_64) URL="https://github.com/radkesvat/ReverseTlsTunnel/releases/download/V7.1/v7.1_linux_amd64.zip" ;; + arm) URL="https://github.com/radkesvat/ReverseTlsTunnel/releases/download/V7.1/v7.1_linux_arm64.zip" ;; + aarch64) URL="https://github.com/radkesvat/ReverseTlsTunnel/releases/download/V7.1/v7.1_linux_arm64.zip" ;; *) echo "Unable to determine system architecture."; exit 1 ;; esac -wget $URL -O v6.9_linux_amd64.zip -unzip -o v6.9_linux_amd64.zip +wget $URL -O v7.1_linux_amd64.zip +unzip -o v7.1_linux_amd64.zip chmod +x RTT -rm v6.9_linux_amd64.zip +rm v7.1_linux_amd64.zip echo "finished." diff --git a/src/foreign_server.nim b/src/foreign_server.nim index d9ffa33..5ef17aa 100644 --- a/src/foreign_server.nim +++ b/src/foreign_server.nim @@ -142,12 +142,11 @@ proc processConnection(client: Connection) {.async.} = packForSend(data, remote.id, remote.port.uint16) await client.twriter.write(data) - echo &"[processRemote] Sent {data.len()} bytes -> client" + if globals.log_data_len: echo &"[processRemote] Sent {data.len()} bytes -> client" if client.isClosing: - # await client.twriter.finish() + await client.twriter.finish() client = await acquireClientConnection(true) - echo "-----------------------------CHANGE--------------------------------------" if client == nil: if globals.log_conn_error: echo "[Error] [processRemote] [loop]: ", "no client for tcp !" break @@ -336,18 +335,17 @@ proc poolController() {.async.} = context.dw_bounds.add conn asyncSpawn processConnection(conn) - await sleepAsync(3000) - if upload: - block initialWriteToOpenBandWidth: - for i in 0..5: - var len = 3000+rand(globals.random_str.len() - 3000) - let random_start = rand(1500) - let full_len = min((len+random_start), globals.random_str.len() - random_start) - var data = globals.random_str[random_start ..< full_len] - let flag: TransferFlags = {DataFlags.junk} - data.flagForSend(flag) - await conn.twriter.write(data) - + # await sleepAsync(3000) + # if upload: + # block initialWriteToOpenBandWidth: + # for i in 0..5: + # var len = 3000+rand(globals.random_str.len() - 3000) + # let random_start = rand(1500) + # let full_len = min((len+random_start), globals.random_str.len() - random_start) + # var data = globals.random_str[random_start ..< full_len] + # let flag: TransferFlags = {DataFlags.junk} + # data.flagForSend(flag) + # await conn.twriter.write(data) else: if globals.log_conn_create: echo "Connecting to iran Timed-out!" diff --git a/src/globals.nim b/src/globals.nim index 940cbe6..4022cce 100644 --- a/src/globals.nim +++ b/src/globals.nim @@ -3,7 +3,7 @@ import dns_resolve, hashes, print, parseopt, strutils, random, net, osproc, strf import checksums/sha1 -const version = "7.0" +const version = "7.1" type RunMode*{.pure.} = enum unspecified, iran, kharej @@ -26,7 +26,7 @@ let full_tls_record_len*: uint = tls13_record_layer.len().uint + tls13_record_la var trust_time*: uint = 3 #secs var upload_cons*: uint = 8 var download_cons*: uint = 8 -var connection_age*: uint = 15 # secs +var connection_age*: uint = 180 # secs var connection_rewind*: uint = 4 # secs # var pool_size*: uint = 24 # var pool_age*: uint = 15