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

[ bsd3, library, web ] [ Propose Tags ] [ Report a vulnerability ]

Please see README.md


[Skip to Readme]

Modules

[Index]

Downloads

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

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0.0
Dependencies base (>=4.7 && <5), foldl (>=1.1 && <1.3), http-client (>=0.4 && <0.6), managed (>=1.0 && <1.1), text (>=1.2 && <1.3), transformers (>=0.4 && <0.6), turtle (>=1.2 && <1.4), uuid (>=1.3 && <1.4) [details]
License BSD-3-Clause
Copyright 2016-2017 Anton Gushcha
Author Anton Gushcha <ncrashed@gmail.com> , Anatoliy Nardid <nazgul17@gmail.com>
Maintainer ncrashed@gmail.com
Revised Revision 1 made by NCrashed at 2017-10-18T23:30:22Z
Category Web
Home page https://github.com/Teaspot-Studio/ssh-tunnel#readme
Source repo head: git clone https://github.com/Teaspot-Studio/ssh-tunnel
Uploaded by NCrashed at 2017-10-18T23:26:38Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 937 total (0 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-10-18 [all 1 reports]

Readme for ssh-tunnel-1.0.0.0

[back to package description]

ssh-tunnel

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>:127.0.0.1:<remoteport> <user>@<host>

Note: that the tunnel is created in background (-f) without a shell on remote host (-N) and (-M -S ) 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.