Any "socket over ssh" library in OCaml?

Hello,

Is there a simple, programmatic way, to connect
two ocaml programs running on different computers
using a socket which is ssh-encapsulated?

I would like to write a distributed program
where the only prerequisite for two programs
to connect would be that I can ssh to the remote machine.
The network topology would be one master program
(probably the computer I seat in front of, where ssh-agent would be configured
and some keys loaded), connecting to several remote computers
where sshd is running and I have access to.

Regards,
F.

The only ssh implementation in OCaml I know of is:

but I’ve never used it so I cannot guaranty it’s what you’re looking for.

1 Like

This is a pretty difficult solution to pull off IMO:

  1. Get awa-ssh to work and forward a port to a remote machine.
  2. Open a socket on the forwarded port and communicate with it.

What I would do is to try and do part 1 by calling out to the ssh executable in the shell. I’m not sure awa-ssh even supports port forwarding. Then just open a socket normally in the OCaml code.

1 Like