[mosh-devel] Mosh.

Geoffrey Thomas geofft at ldpreload.com
Sun May 4 06:41:40 EDT 2014


A while ago I did a little bit of work to make mosh-client a wrapper 
around a static libmoshclient.a and then got distracted before finishing 
it. I did end up with a usable library if what you wanted was very, very 
similar to mosh-client (my end goal was a standalone mobile or desktop app 
that didn't rely on having a local terminal emulator). Part of where I 
stopped was figuring out what a public API should look like for apps that 
usefully different from mosh-client, so I'd be curious what you're looking 
for, and especially if you have constraints about the tiny amount of 
Mosh-specific UI (prediction, the blue bar at the top, etc.) or the 
network layer.

My branch is on GitHub, although this is mostly a backup of my work 
instead of a commit history intended being to be particularly useful to 
others:
https://github.com/geofft/mosh/commits/embeddedclient
In particular, I split src/frontend/moshclient.cc into a somewhat generic 
embeddedclient.cc and a very simple emdriver.cc that just printed 
screen updates with printf.

I could probably be talked into rebasing this onto current HEAD and 
finishing up the work to port mosh-client itself to the same API if 
there's other interest having an API.

-- 
Geoffrey Thomas
https://ldpreload.com
geofft at ldpreload.com

On Sun, 4 May 2014, Keith Winstein wrote:

> Hello Jonathan,
>
> Happy to hear Mosh is helpful! Re: an API, you might take a look at
> how the mosh-client program is implemented
> (https://github.com/keithw/mosh/blob/master/src/frontend/mosh-client.cc).
> It instantiates an STMClient object, calls the init() method, and then
> the main() method, which encapsulates the whole eventloop.
>
> Not sure if this is quite what you're looking for, but maybe if you
> tell us some more about your use case we might be able to be more
> helpful. As you probably know, Mosh is really only useful for
> conveying an interactive terminal over the network; it's not really
> set up to be a general communications layer for arbitrary streams.
>
> Best regards,
> Keith
>
> On Fri, May 2, 2014 at 6:54 PM, Jonathan Barronville
> <jonathan at belairlabs.com> wrote:
>> Hi, Keith.
>>
>> My name is Jonathan Barronville. I'm a hacker here in Boston.
>> I've been using Mosh for a while now and I really really enjoy it.
>> Thanks so much for building it!
>>
>> Anyway, I'm working on a project for virtual machine management and I want
>> to use Mosh for the communication layer, rather than simply using SSH. Now,
>> I have a fairly good understanding of how Mosh works and have even glanced
>> through some of the code, but I was somewhat disappointed to find that Mosh
>> doesn't have some type of main high-level C (or even C++) API I could use.
>> In other words, it would be great if I could just link to libmosh or
>> something like that, include a header, and just call a couple high-level
>> functions. Maybe I'm not looking in the right place ... how straightforward
>> is this with Mosh? All I need is a main entry point (like a header) to use
>> some high-level Mosh functions (something like `mosh_connect()` for
>> example).
>>
>> Please let me know what you think or at least, if possible, give me a few
>> pointers.
>> Thanks!
>> Have a good one!
>>
>> - Jonathan
> _______________________________________________
> mosh-devel mailing list
> mosh-devel at mit.edu
> http://mailman.mit.edu/mailman/listinfo/mosh-devel
>



More information about the mosh-devel mailing list