Skip to content

Commit

Permalink
Increase buffer size from 32KB to 128KB to improve download speeds.
Browse files Browse the repository at this point in the history
  • Loading branch information
doxx authored and doxx committed Dec 3, 2024
1 parent 741f9d1 commit 74dad3a
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 18 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Breaking past blocked sites!

## NordVPN

1. Download the OpenVPN client
1. Download the OpenVPN client (cli is better)
2. Under Manual setup in your NordVPN web account download the .ovpn file for TCP
3. Also in Manual setup select username and password authentication.
4. Edit the .ovpn file and change the IP and port to your darkflare server IP and Port.
Expand All @@ -81,11 +81,13 @@ Breaking past blocked sites!

I did provide an ./examples/nordvpn.ovpn for you to use. Also two scrips for up/down to fix some of the routing issues.

Speed tests were around 30Mbps down and 10Mbps up with latency around 30-100ms. Streaming, etc... all seem to work fine.
Using the OpenVPN commandline client you can embed the username, password, and it runs the scripts properly for you:
```
& openvpn --config 127.0.0.1.tcp2222.ovpn --script-security 2
```

Note: OpenVPN does some weird thing with the default gateway/route. For testing purposes I added: pull-filter ignore "redirect-gateway" to the .ovpn file. That allows me to force the tunnel to not eat my network.
Note: OpenVPN by default screws up the default gateway/route. For testing purposes I added: pull-filter ignore "redirect-gateway" to the .ovpn file. That allows me to force the tunnel to not change the routing. The routing can be fixed by the OpenVPN-up.sh and OpenVPN-down.sh scripts. This is due to the fact that the VPN is connecting to the whole CDN range of IP addresses.

![OpenVPN on NordVPN over TCPoCDN](https://raw.githubusercontent.com/doxx/darkflare/main/images/openvpn.jpg)

## 🔐 Few Obscureation Techniques

Expand Down
14 changes: 7 additions & 7 deletions bin/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# DarkFlare Binary Checksums
# Generated: Tue Dec 3 17:54:24 UTC 2024
# Generated: Tue Dec 3 19:19:42 UTC 2024

a46b3d02d570810b4cd85423b9aa4a564e22086362de8b13ef8d7c10e64e129b checksums.txt
d74d77f413a7607cb742678bb2cc35ea009ef9e9bedeb8f6461a4f5222c52a33 checksums.txt
444278a858153540bc7b8ba97435d6d73e93e5fb93cc767373606463b1410c16 darkflare-client-darwin-amd64
3d2eb54b97b4aa09949d94985e1dcc6fff363b22be8362d26b45e2f258403f98 darkflare-client-darwin-arm64
46de95f637486958231679b1ea53f5bb724c9b731d323c9cf0528c5cd2dc41d9 darkflare-client-linux-amd64
866618bb5ca641a8fa78823fa2dc4d235086c47d8ae7a2210613fd9b94bd4681 darkflare-client-linux-arm64
4dc79e82b47ce82ca894431756c0f9b5620fcc0d228bdbefbd106b7c354c17cd darkflare-client-windows-amd64.exe
fed50b0112f4c80e15376294efa1e7b6f7e6543ff2fe145b177cd69c0dc3b7d0 darkflare-server-darwin-amd64
61ee16be9e15cf94edf77740ee54d201e25343e5794fbee1b16aa8bb6d5a7fb2 darkflare-server-darwin-arm64
6870ba3b61938d43138f30b99e1685a9917570cd95e197e59b641cd54d90343d darkflare-server-linux-amd64
d7e4e70e41df73291305552efdc9ee1b4af98f8b54480ed0a7ce159b3f455466 darkflare-server-linux-arm64
8f7c75ed6b08f15dbfa289c17a44e9ddfe2fbf08012f1d3e2804be595ba5c2e9 darkflare-server-windows-amd64.exe
0df41165f843f3e53c9de5d9c5ec94660696d20cc6b6da3f28fe9ddaee696e4f darkflare-server-darwin-amd64
05d6156bd38ac90784ff4b862cbc83d9c77b047237f0d731b10faf78b728878c darkflare-server-darwin-arm64
88a2c60f99d0372d7e71593f724fbedef1a5cdd4c53eb215e87f969f6d6788ae darkflare-server-linux-amd64
404ed6254b31f39ee42a6906d9b1a6d2af8050e2f81df14316ac95e9db3f9c70 darkflare-server-linux-arm64
9178c5f3f06182ef150237b8aa97802679b2def2edde271c909c81271aca7a6b darkflare-server-windows-amd64.exe
Binary file modified bin/darkflare-server-darwin-amd64
Binary file not shown.
Binary file modified bin/darkflare-server-darwin-arm64
Binary file not shown.
Binary file modified bin/darkflare-server-linux-amd64
Binary file not shown.
Binary file modified bin/darkflare-server-linux-arm64
Binary file not shown.
Binary file modified bin/darkflare-server-windows-amd64.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions examples/OpenVPN-down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Exit on any error
set -e

# Set PATH to include common system binary locations
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"

# File containing the original default gateway
default_route_file="default-router.txt"

Expand Down
3 changes: 3 additions & 0 deletions examples/OpenVPN-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Exit on any error
set -e

# Set PATH to include common system binary locations
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"

# File to save the original default route
default_route_file="default-router.txt"

Expand Down
13 changes: 6 additions & 7 deletions server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,11 @@ func (s *Server) handleRequest(w http.ResponseWriter, r *http.Request) {
}

// For GET requests, read any available data
buffer := make([]byte, 32*1024) // 32KB buffer
readData := make([]byte, 0, 64*1024) // 64KB initial capacity
buffer := make([]byte, 128*1024) // 128KB buffer
readData := make([]byte, 0, 256*1024) // 256KB initial capacity

for {
session.conn.SetReadDeadline(time.Now().Add(100 * time.Millisecond)) // Increased from 10ms to 100ms
session.conn.SetReadDeadline(time.Now().Add(250 * time.Millisecond)) // Increased from 10ms to 250ms
n, err := session.conn.Read(buffer)
if err != nil {
if err != io.EOF && !err.(net.Error).Timeout() {
Expand All @@ -394,7 +394,7 @@ func (s *Server) handleRequest(w http.ResponseWriter, r *http.Request) {
if n > 0 {
readData = append(readData, buffer[:n]...)
}
if n < len(buffer) || len(readData) >= 64*1024 { // Added size limit check
if n < len(buffer) || len(readData) >= 256*1024 { // Added size limit check
break
}
}
Expand Down Expand Up @@ -440,9 +440,8 @@ func (s *Server) trackSessionStats(sessionID string, session *Session) {
upKbps := float64(upBytes*8) / (1024 * duration)
downKbps := float64(downBytes*8) / (1024 * duration)

log.Printf("[%s] Stats: ID=%s, Source=%s, Up=%d bytes (%.2f kbps), Down=%d bytes (%.2f kbps)",
time.Now().Format(time.RFC3339),
sessionID[:8],
log.Printf("Stats: ID=%s, Source=%s, Up=%d bytes (%.2f kbps), Down=%d bytes (%.2f kbps)",
sessionID,
session.sourceIP,
upBytes,
upKbps,
Expand Down

0 comments on commit 74dad3a

Please sign in to comment.