https://github.com/lcahlander/exist-jsch
XQuery function wrapper around Jsch
https://github.com/lcahlander/exist-jsch
exist-db jsch ssh-tunnel xquery
Last synced: 12 months ago
JSON representation
XQuery function wrapper around Jsch
- Host: GitHub
- URL: https://github.com/lcahlander/exist-jsch
- Owner: lcahlander
- License: bsd-3-clause
- Created: 2020-03-03T15:03:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-01T21:27:29.000Z (about 2 years ago)
- Last Synced: 2025-06-09T14:54:32.658Z (about 1 year ago)
- Topics: exist-db, jsch, ssh-tunnel, xquery
- Language: Java
- Size: 45.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SSH Library for eXist-db
This library is a wrapper around the JSch library.
There are two functions defined. One is to establish an SSH session and the other is to setup port forwarding once the session is established.
```xquery
xquery version "3.1";
import module namespace ssh = "https://exist-db.org/exist-db/ns/app/jsch";
ssh:get-session("10.211.55.15", "parallels", "xxxxxxxx")
```
This returns an xs:long that is a handle to the session. That session handle is used by the `forward-port` function.
```xquery
xquery version "3.1";
import module namespace ssh = "https://exist-db.org/exist-db/ns/app/jsch";
let $session := ssh:get-session("10.211.55.15", "parallels", "xxxxxxxx")
return ssh:forward-port($session, 5656, "secure.example.com", 3306)
```