Merge branch 'master' into git-lfs

This commit is contained in:
Joey Hess 2019-08-05 11:48:45 -04:00
commit c527ae5887
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
21 changed files with 845 additions and 71 deletions

View file

@ -5,6 +5,8 @@
- Licensed under the GNU AGPL version 3 or higher.
-}
{-# LANGUAGE CPP #-}
module Utility.Tor where
import Common
@ -37,7 +39,12 @@ connectHiddenService (OnionAddress address) port = do
return s
where
torsocksport = 9050
#if MIN_VERSION_socks(0,6,0)
torsockconf = defaultSocksConf $ SockAddrInet torsocksport $
tupleToHostAddress (127,0,0,1)
#else
torsockconf = defaultSocksConf "127.0.0.1" torsocksport
#endif
socksdomain = SocksAddrDomainName (BU8.fromString address)
socksaddr = SocksAddress socksdomain (fromIntegral port)