br101 / pingcheck

Check connectivity of interfaces in OpenWRT
GNU General Public License v2.0
51 stars 15 forks source link

HTTP content comparison for captive portals #16

Open jonesmz opened 4 years ago

jonesmz commented 4 years ago

I have a situation where my OpenWRT device might be deployed behind a captive portal style firewall, which will intercept TCP traffic and redirect, but won't intercept ICMP.

I'd like to have the ONLINE status of an interface be the logical AND of all configured protocols.

Is this practical?

br101 commented 4 years ago

Yes would be possible but unlikely i implement it in the next couple of months...

jonesmz commented 4 years ago

I will try my hand at implementing support for this.

Can you give me some suggestions on how an "acceptable to merge" pull request would look from your perspective?

br101 commented 3 years ago

Hmm, thinking about it I don't really understand the requirement. If the captive portal doesn't block ICMP it would go thru and you can check if you are online "theoretically" (independent if the captive portal blocks TCP or not). If the portal always redirects TCP traffic, what do you gain by testing for TCP as well (it will always be positive)? Maybe I misunderstand but I'd like to make sure the feature is useful if i spend time implementing it

jonesmz commented 3 years ago

I'm no longer involved in the project that this feature request was opened on behalf of, and no longer intend to work on this feature.

But to clarify my meaning here, my objective was to take the code that was added for this feature request, and enhance it to allow for checking a full http connection with content comparison. E.g. check the public Google or Mozilla captive portal check pages against a static string in the config file.

The reason for wanting this to be done at the level of the pingcheck program is to allow for the event that gets generated when the complex-ping fails to drive higher level program behaviour. E.g. I wanted one centrally located place to say "This connection is able to support general purpose traffic".

br101 commented 3 years ago

Yes that would make sense. Changed the title accordingly.