Skip to content

Commit

Permalink
7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RadKesvat committed Dec 22, 2023
1 parent a59219c commit 8e59587
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
4 changes: 2 additions & 2 deletions config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 6 additions & 6 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."

Expand Down
28 changes: 13 additions & 15 deletions src/foreign_server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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!"
Expand Down
4 changes: 2 additions & 2 deletions src/globals.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8e59587

Please sign in to comment.