ssh-tunnel: Proxy http-client via ssh tunnel.

[ bsd3, library, web ] [ Propose Tags ]

Please see

[Skip to Readme]
Versions [faq]
Dependencies base (>=4.7 && <5), foldl (>=1.1 && <1.3), http-client (>=0.4 && <0.6), managed (==1.0.*), text (==1.2.*), transformers (>=0.4 && <0.6), turtle (>=1.2 && <1.4), uuid (==1.3.*) [details]
License BSD-3-Clause
Copyright 2016-2017 Anton Gushcha
Author Anton Gushcha <> , Anatoliy Nardid <>
Revised Revision 1 made by NCrashed at 2017-10-18T23:30:22Z
Category Web
Home page
Source repo head: git clone
Uploaded by NCrashed at 2017-10-18T23:26:38Z
Distributions NixOS:
Downloads 710 total (5 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2017-10-18 [all 1 reports]




Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees

Readme for ssh-tunnel-

[back to package description]


Small library that allows to create SSH tunnel (SOCKS proxy) from Haskell and proxy http-client.

Tunnel is created with:

ssh -f -N -M -S <master-socket> -i <pemfile> -L <localport>:<remoteport> <user>@<host>

Note: that the tunnel is created in background (-f) without a shell on remote host (-N) and (-M -S <master-socket>) defines special socket that is used to terminate the tunnel.

How to use in your code:

import Control.Monad.Managed
import Control.SSH.Tunnel
import Network.HTTP.Client
import Network.HTTP.Client.TLS

with (openSshTunnel config tlsManagerSettings) $ \settings -> do
 manager <- newManager settings
 -- do things with manager
 -- as soon you live the scope, tunnel will be down

Also, you can find addFingerprints function useful for adding fingerprints to known hosts on first connect.