summaryrefslogtreecommitdiff
path: root/Remote/Helper/Tor.hs
blob: b5a819c3b7a68e2ff918572c5f67e01dfe7156d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{- Helpers for tor remotes.
 -
 - Copyright 2016 Joey Hess <id@joeyh.name>
 -
 - Licensed under the GNU GPL version 3 or higher.
 -}

module Remote.Helper.Tor where

import Annex.Common

import Network.Socket

torHandle :: Socket -> IO Handle
torHandle s = do
	h <- socketToHandle s ReadWriteMode
	hSetBuffering h LineBuffering
	hSetBinaryMode h False
	fileEncoding h
	return h