Create shell from

+1 vote
asked Sep 2, 2014 by tsahi (360 points)
edited Sep 4, 2014

I want to create an ASP.NET application which does telnet commands. I want the user to get a shell where he can do all of his commands. Is it possible with Rebex? Is there an web example which does that?

3 Answers

+2 votes
answered Sep 2, 2014 by Lukas Pokorny (128,250 points)
edited Apr 15, 2016 by Lukas Pokorny
Best answer

Rebex Terminal Emulation can be used from ASP.NET applications, but it doesn't include an ASP.NET-based terminal control. Fortunately, there are several ways around this.

Essentially, what you need is to have a Rebex Terminal Emulation running on the server (as part of your ASP.NET application), but make it display the terminal screen using the client's web browser (and make the browser send back keystrokes).

Some of our clients have used VirtualTerminal's screen scraping capabilities to retrieve a HTML code to send to the browser to display, but although this is suitable for some scenarios, it is not perfect.

A better option is to implement an AJAX client-side control that establishes a WebSocket connection to the ASP.NET application, receives screen data and updates its screen accordingly (and send back the keystrokes).

Rebex Terminal control supports custom render targets, and a proof-of-concept solution (download) that shows how to use it with HTML5 canvas and SignalR 2 to achieve this:

alt text

The web application supports both SSH and telnet (please note that username/password is only relevant to SSH) and works in all major browsers, although possibly not in some of their outdated versions.

The code is not yet production quality - it lacks comments, doesn't handle some kinds of errors very well, does not prevent some keystrokes from invoking default behavior, does not support resizing, etc. However, it demonstrates that implementing a browser-based terminal client using Rebex Terminal Emulation is not complicated.

Any feedback is welcome!

commented Apr 14, 2016 by anonymous
Hey Lukas, any chance you would have an updated sample.  I d/l the sample you had on this post, but the license for the trial version has expired.
commented Apr 15, 2016 by Lukas Pokorny (128,250 points)
edited Nov 22, 2019 by Lukas Pokorny
0 votes
answered Sep 3, 2014 by tsahi (360 points)
edited Sep 3, 2014

Hi Lukas,

Thanks for your help. Waiting to see your code

commented Sep 3, 2014 by Lukas Pokorny (128,250 points)
edited Sep 3, 2014

I edited my original answer. It now includes a link to the code. Please give it a try and let me know what you think.

0 votes
answered Sep 4, 2014 by tsahi (360 points)
edited Sep 4, 2014

Thanks Lukas!! this is exactly what I was looking for