Amebis / eduVPN

Windows eduVPN Client
GNU General Public License v3.0
41 stars 16 forks source link

Implement happy eyeballs #159

Closed jornane closed 2 years ago

jornane commented 3 years ago

Happy eyeballs is an algorithm to make dual stack work better. Our eduVPN servers are dual stack, and if someone has bad working IPv6, or IPv6 at the server works bad, the discovery and retrieval of tokens will error out randomly.

Related to this, we should also check if the client handles DNS roundrobin correctly, given that we want to use this for the discovery CDN.

rozmansi commented 3 years ago

The Windows client is using .NET Framework 4.5 for HTTPS (System.Net.WebRequest class). It is like this: image

To implement the Happy eyeballs, we'd need something more sophisticated. Like this: image

So, basically, we'd need to implement the complete stack from TCP/IP up anew. Maybe there's a C library for an HTTP client we can compile with MSVC (curl, wget) and provide a managed class wrappers, so it can be used from C#?

Or, wait for Microsoft to implement this in a more recent .NET Framework. Which might take decades.

jornane commented 3 years ago

I found this while searching for ways to incorporate curl in a C# project

https://stackoverflow.com/questions/7929013/making-a-curl-call-in-c-sharp

I see you use HttpWebRequest, I use WebClient in another project. Your first illustration captures both of these very well. But HttpClient (can use WinHttpHandler) looks promising. I'll check it out a bit myself, and I'll report back here if it looks more like the second illustration.

ghost commented 2 years ago

This would be possible when we switch to Go shared code, just like #158 would be tackled by this.