summaryrefslogtreecommitdiffhomepage
path: root/Servers.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-09-12 23:09:37 -0400
committerJoey Hess <joeyh@joeyh.name>2016-09-12 23:09:37 -0400
commit3de39735765344b3728f5649e47d27b69f9094f4 (patch)
tree1379cfd32390bfe3c12b74c47ff9a358e963e18a /Servers.hs
parente333a779338ff8bccdc4225fc953d6f4f0226db0 (diff)
downloadkeysafe-3de39735765344b3728f5649e47d27b69f9094f4.tar.gz
refactor
Diffstat (limited to 'Servers.hs')
-rw-r--r--Servers.hs28
1 files changed, 28 insertions, 0 deletions
diff --git a/Servers.hs b/Servers.hs
new file mode 100644
index 0000000..ddc0d6e
--- /dev/null
+++ b/Servers.hs
@@ -0,0 +1,28 @@
+{- Copyright 2016 Joey Hess <id@joeyh.name>
+ -
+ - Licensed under the GNU AGPL version 3 or higher.
+ -}
+
+module Servers where
+
+import Network.Wai.Handler.Warp (Port)
+import Servant.Client
+
+type HostName = String
+
+data Server = Server
+ { serverName :: HostName
+ , serverPort :: Port
+ }
+
+serverUrl :: Server -> BaseUrl
+serverUrl srv = BaseUrl Http (serverName srv) (serverPort srv) ""
+
+-- | These can be either tor .onion addresses, or regular hostnames.
+-- Using tor is highly recommended, to avoid correlation attacks.
+networkServers :: IO [Server]
+networkServers = return
+ [ Server "vzgrspuxbtnlrtup.onion" 4242 -- keysafe.joeyh.name
+ , Server "localhost" 4242
+ , Server "localhost" 4242
+ ]