-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to verify TCP pings #465
base: main
Are you sure you want to change the base?
Add an option to verify TCP pings #465
Conversation
This enables user-defined captive portal detection by adding a hook to `VintageNet.Connectivity.TCPPing` so that consumers can perform a custom test against the established TCP connection (such as a TLS handshake).
9d6866b
to
b3e68c8
Compare
@@ -11,7 +11,7 @@ defmodule VintageNet.Connectivity.HostList do | |||
@type ip_or_hostname() :: :inet.ip_address() | String.t() | |||
|
|||
@type name_port() :: {ip_or_hostname(), 1..65535} | |||
@type ip_port() :: {:inet.ip_address(), 1..65535} | |||
@type name_ip_port() :: {ip_or_hostname(), :inet.ip_address(), 1..65535} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems kind of ugly, but it was necessary in order to preserve the original hostname for custom verify funs to use for SNI.
This definitely needs some more work. Assuming that you have eth0 connected to a network that redirects the internet to a captive portal, this is the current behavior:
|
I believe that the TCP stats check will miss short TCP sessions, but it seems like it could easily confound testing. The other thing is that you really need two network interfaces active to test this. The distinction between Perhaps we can brainstorm what to do and other options. I like the idea of having a better internet check. I'm also wondering if we should think about making the connection to backend servers less aggressively switch. Like perhaps not switching to the better network interface when there's a working connection unless the network interface has been good for 5 minutes (for example). This is not a fix to the general captive portal issue, but I think that it may be a fix to what we're seeing with the captive portal appearing for a short time before going away. |
This enables user-defined captive portal detection by adding a hook
to
VintageNet.Connectivity.TCPPing
so that consumers can perform acustom test against the established TCP connection (such as a TLS
handshake).