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

[ bsd3, library, web ] [ Propose Tags ]

Please see README.md


[Skip to Readme]
Versions 1.0.0.0
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 <ncrashed@gmail.com> , Anatoliy Nardid <nazgul17@gmail.com>
Maintainer ncrashed@gmail.com
Revised Revision 1 made by NCrashed at Wed Oct 18 23:30:22 UTC 2017
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 Wed Oct 18 23:26:38 UTC 2017
Distributions NixOS:1.0.0.0
Downloads 317 total (8 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

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

For package maintainers and hackage trustees


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 <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.