High-level access to HTTPS Everywhere rulesets.
Go to file
vi ed1933f2c5 Remove the IO bottleneck.
Don't redundantly readIO/parse the rulesets; do this once, lazily
carrying out the involved operations. Rulesets are invariant over
executions.

This improves performance by a few orders of magnitude. Though at some
point we should substitute linear search for lookup on a generalised
suffix tree of rooted domains.

Breaking interface change, though I'll likely restore the old form
soon with IO TH.
2017-12-06 13:21:57 +01:00
examples Remove the IO bottleneck. 2017-12-06 13:21:57 +01:00
ref Don't admit package-wise parameterisation of rulesets. 2015-11-08 00:53:35 +08:00
src/Data Remove the IO bottleneck. 2017-12-06 13:21:57 +01:00
test Avoid the regular expression engine in parsing rule targets. 2017-12-05 20:54:40 +01:00
vendor Fast-forward upstream ruleset. 2017-12-05 17:38:39 +01:00
.gitignore Stack, AMP. 2015-11-04 23:15:07 +08:00
.gitmodules Don't admit package-wise parameterisation of rulesets. 2015-11-08 00:53:35 +08:00
DEBT.md Don't admit package-wise parameterisation of rulesets. 2015-11-08 00:53:35 +08:00
LICENSE Incomplete parser for HTTPS Everywhere rulesets. 2014-08-10 04:23:41 +08:00
README.md Remove the IO bottleneck. 2017-12-06 13:21:57 +01:00
Setup.hs Don't admit package-wise parameterisation of rulesets. 2015-11-08 00:53:35 +08:00
https-everywhere-rules.cabal Another example: CountUpgradeable. 2017-12-05 21:51:40 +01:00
stack.yaml Dependency upgrades; lts-8.24. 2017-12-05 17:23:37 +01:00

README.md

https-everywhere-rules

Haskell package providing high-level access to HTTPS Everywhere rulesets. It aims to make it easier to specify: "use secure HTTP connections when possible."

λ: :m + Data.HTTPSEverywhere.Rules Network.URI
λ: rulesets <- getRulesets
λ: let Just eff = parseURI "http://www.eff.org/document/eff-and-aclu-amicus-brief-klayman"
λ: rewriteURL rulesets eff
https://www.eff.org/document/eff-and-aclu-amicus-brief-klayman
λ: :m + Network.HTTP.Client Network.HTTP.Client.TLS Control.Applicative Control.Lens
λ: (req, hub) <- (,) <*> getUri <$> parseUrl "https://github.com/fmap/https-everywhere-rules"
λ: newManager tlsManagerSettings >>= httpNoBody req <&> destroyCookieJar . responseCookieJar >>= mapM (rewriteCookie rulesets hub)
[Cookie {cookie_name = "_gh_sess", cookie_value = "eyJzZXNzaW9uX2lkIjoiNjBlM2FiOTIxNTdhZTNhNDE5YWQ0ZTk4ZWQzNDRjMjEiLCJzcHlfcmVwbyI6ImZtYXAvaHR0cHMtZXZlcnl3aGVyZS1ydWxlcyIsInNweV9yZXBvX2F0IjoxNDA4ODk2OTM2LCJfY3NyZl90b2tlbiI6IktkbTlwN2JqNGptVmhrYjFIUm9BbkV0a1JTQXRDUXJid2g4VWo4N1g0Q1U9In0%3D--d378daa262b8c12bb82246d5de6b3adc353a3db7", cookie_expiry_time = 3013-12-25 00:00:00 UTC, cookie_domain = "github.com", cookie_path = "/", cookie_creation_time = 2014-08-24 16:15:37.815144 UTC, cookie_last_access_time = 2014-08-24 16:15:37.815144 UTC, cookie_persistent = False, cookie_host_only = True, cookie_secure_only = True, cookie_http_only = True},Cookie {cookie_name = "logged_in", cookie_value = "no", cookie_expiry_time = 2034-08-24 16:15:36 UTC, cookie_domain = "github.com", cookie_path = "/", cookie_creation_time = 2014-08-24 16:15:37.815144 UTC, cookie_last_access_time = 2014-08-24 16:15:37.815144 UTC, cookie_persistent = True, cookie_host_only = False, cookie_secure_only = True, cookie_http_only = True}]