The ssh-tunnel package

[ Tags: bsd3, library, web ] [ Propose Tags ]

Please see

[Skip to Readme]


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 BSD3
Copyright 2016-2017 Anton Gushcha
Author Anton Gushcha <> , Anatoliy Nardid <>
Category Web
Home page
Source repo head: git clone
Uploaded Wed Oct 18 23:26:38 UTC 2017 by NCrashed
Updated Wed Oct 18 23:30:22 UTC 2017 by NCrashed to revision 1   [What is this?]
Distributions NixOS:
Downloads 273 total (5 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-10-18 [all 1 reports]
Hackage Matrix CI




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.