Create shell from asp.net

+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 (92,430 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 would be 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). This will be easier with the next release which will support custom render targets.


Fortunately, with the help of HTML5 canvas and SignalR 2, creating a proof-of-concept solution was quite simple - just download the code (includes Rebex Terminal Emulation beta) and give it a try!


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 sgtidwell (100 points)
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 (92,430 points)
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 (92,430 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

...