Updated:
➤ added webfilter.pb.
/*
* DESCRIPTION:
* This is a simple web (HTTP) filter using WinDivert.
*
* It works by intercepting outbound HTTP GET/POST requests and matching
* the URL against a blacklist. If the URL is matched, we hijack the TCP
* connection, reseting the connection at the server end, and sending a
* blockpage to the browser.
*/
All the relevant parts have been converted, but it didn't make sense to spend too much time on some functions.
The following C functions were excluded and replaced with a simplified PureBasic Procedure (BlackListMatch):
• UrlCompare
• UrlMatch
• BlackListSort
• BlackListMatch
Quote from the creator of WinDivert:
• It's worth reading the response from the author as he modified the example to be relevant.
• And in this
post where the author also made changes to the example making it relevant.
basil wrote:The webfilter example is not very useful. It only supports HTTP/1.1, which was somewhat relevant in 2011 when it was first written, but is no longer relevant as almost all websites/browsers use encryption + more modern web protocols. This sample should be retired.
The difference between stupidity and genius is that genius has its limits.
~ Albert Einstein