[Python] Experiencing Packet Loss with Custom TCP-Based VPN [closed]

Discussão em 'Python' iniciado por Stack, Junho 24, 2025.

  1. Stack

    Stack Membro Participativo

    I'm building a custom VPN where packets from the client are intercepted using WinDivert, encrypted, and sent to a server. The server decrypts them, forwards the traffic to the internet, captures the response, re-encrypts it, and sends it back to the client, which then reinjects it.

    Sometimes, when I run the code, everything works — I can load Google or other websites just fine. But other times, the exact same code fails to load anything, and the browser just hangs. However, when I test using a local server that returns a static string (instead of accessing real websites), it always works.

    This suggests the base communication logic is fine, but the handling of full web traffic might be flawed. and i believe theres a packet loss somewhere.

    https://github.com/Raz2089/vpn2

    What I've Tried: Intercepting all TCP/UDP packets and redirecting their destination to the VPN server.

    Forwarding those packets from the server to the internet and sending the responses back.

    Ensured encryption and decryption are correctly handled on both ends (AES-CBC 256-bit with padding).

    Verified connection mapping logic between incoming/outgoing packets.

    Attempted to prevent duplicate packets using fingerprints.

    Continue reading...

Compartilhe esta Página