2014-08-09 22:23:41 +02:00
|
|
|
[https-everywhere-rules](https://github.com/fmap/https-everywhere-rules)
|
|
|
|
========================================================================
|
|
|
|
|
2014-08-24 06:57:50 +02:00
|
|
|
Haskell package providing high-level access to [HTTPS Everywhere][1]
|
2014-08-24 19:48:04 +02:00
|
|
|
rulesets. It aims to make it easier to specify: "use secure HTTP
|
|
|
|
connections when possible."
|
2014-08-24 06:57:50 +02:00
|
|
|
|
2014-08-24 08:06:22 +02:00
|
|
|
[1]: https://www.eff.org/https-everywhere
|
|
|
|
|
2014-08-24 06:57:50 +02:00
|
|
|
```haskell
|
|
|
|
λ: :m + Data.HTTPSEverywhere.Rules Network.URI
|
2017-12-11 04:29:19 +01:00
|
|
|
λ: rules <- getRulesets
|
|
|
|
λ: let Just it = parseURI "http://httpsnow.org"
|
|
|
|
λ: rewriteURL rules it
|
|
|
|
https://httpsnow.org
|
2014-08-24 18:18:08 +02:00
|
|
|
λ: :m + Network.HTTP.Client Network.HTTP.Client.TLS Control.Applicative Control.Lens
|
|
|
|
λ: (req, hub) <- (,) <*> getUri <$> parseUrl "https://github.com/fmap/https-everywhere-rules"
|
2017-12-11 04:29:19 +01:00
|
|
|
λ: newManager tlsManagerSettings >>= httpNoBody req <&> destroyCookieJar . responseCookieJar >>= mapM (rewriteCookie rules hub)
|
2014-08-24 18:18:08 +02:00
|
|
|
[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}]
|
2014-08-24 06:57:50 +02:00
|
|
|
```
|