Created
May 23, 2015 11:16
-
-
Save artyom-poptsov/8e131ed3997df712c9e3 to your computer and use it in GitHub Desktop.
guile-ssh-tunnel-example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/guile \ | |
-e main | |
!# | |
(use-modules (ssh session) | |
(ssh auth) | |
(ssh key) | |
(ssh tunnel)) | |
(define (main args) | |
(let ((s (make-session #:user "alice" | |
#:host "localhost" | |
#:port 22 | |
#:log-verbosity 'nolog)) | |
(k (private-key-from-file "/home/alice/.ssh/id_rsa"))) | |
(connect! s) | |
(userauth-public-key! s k) | |
(let ((t (make-tunnel s | |
#:local-port 8080 | |
#:remote-host "www.example.org" | |
#:remote-port 80))) | |
(start-forward t)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Although the port forwarding functionality is still under development (see the branch
wip-port-forwarding
-- https://github.com/artyom-poptsov/guile-ssh/tree/wip-port-forwarding), it is already possible to do something like this.