Telnet emulation with Javascript/dhtml

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Questman

    Telnet emulation with Javascript/dhtml


    Does anyone have code they could share that would implement a telnet
    session in a browser using Javascript? I've seen it done once, but they
    did not have code available. This would be integral to preserving some
    old telnet-based software but allowing us to move on with web-only code
    at this point.

    Thank you in advance to anyone who can assist.

    (Ideally, it should be cross-browser, of course).

    Rick

  • Kimmo Laine

    #2
    Re: Telnet emulation with Javascript/dhtml

    "Questman" <questman@UBESU Xthemajorbbs.co m> kirjoitti
    viestissä:fApKe .6195$4l5.1070@ fe80.usenetserv er.com...[color=blue]
    >
    > Does anyone have code they could share that would implement a telnet
    > session in a browser using Javascript? I've seen it done once, but they
    > did not have code available. This would be integral to preserving some
    > old telnet-based software but allowing us to move on with web-only code at
    > this point.
    >
    > Thank you in advance to anyone who can assist.
    >
    > (Ideally, it should be cross-browser, of course).[/color]


    Java Applet might be what you need. Javascript does not provide such
    functionality unless... Hmm. You could possibly make an AJAX/CGI application
    which would use a serverside script to telnet and javascript/xmlRequest to
    display the output to the client. Still, I'd start making a Java Applet for
    that if I were you.

    --
    SETI @ Home - Donate your cpu's idle time to science.
    Further reading at <http://setiweb.ssl.ber keley.edu/>
    Kimmo Laine <eternal.erecti onN0@5P4Mgmail. com>


    Comment

    • Justin Koivisto

      #3
      Re: Telnet emulation with Javascript/dhtml

      Kimmo Laine wrote:
      [color=blue]
      > "Questman" <questman@UBESU Xthemajorbbs.co m> kirjoitti
      > viestissä:fApKe .6195$4l5.1070@ fe80.usenetserv er.com...
      >[color=green]
      >>Does anyone have code they could share that would implement a telnet
      >>session in a browser using Javascript? I've seen it done once, but they
      >>did not have code available. This would be integral to preserving some
      >>old telnet-based software but allowing us to move on with web-only code at
      >>this point.
      >>
      >>Thank you in advance to anyone who can assist.
      >>
      >>(Ideally, it should be cross-browser, of course).[/color]
      >
      > Java Applet might be what you need. Javascript does not provide such
      > functionality unless... Hmm. You could possibly make an AJAX/CGI application
      > which would use a serverside script to telnet and javascript/xmlRequest to
      > display the output to the client. Still, I'd start making a Java Applet for
      > that if I were you.
      >[/color]

      For that matter, if it isn't something that needs intervention, set up a
      server-side script (php, asp, etc.) to accept the data that will be sent
      via post or something, and have the script execute all the necessary
      actions.

      --
      Justin Koivisto, ZCE - justin@koivi.co m

      Comment

      • Questman

        #4
        Re: Telnet emulation with Javascript/dhtml

        Kimmo Laine wrote:[color=blue]
        >
        >
        >
        > Java Applet might be what you need. Javascript does not provide such
        > functionality unless... Hmm. You could possibly make an AJAX/CGI application
        > which would use a serverside script to telnet and javascript/xmlRequest to
        > display the output to the client. Still, I'd start making a Java Applet for
        > that if I were you.
        >[/color]

        Hi Kimmo,

        The problem with an Applet is that many browsers turn off the
        functionality for "security" or performance reasons.

        Ideally, the goal to get javascript functionality is to have a stock
        browser be able to access this content.

        Unfortunately, it also needs interaction...

        Here's an example of what I'm talking about doing :



        I've tried contacting these blokes but they do not respond..
        So I now wish to develop my own version, but don't really know where to
        start.

        Rick

        Comment

        • Kimmo Laine

          #5
          Re: Telnet emulation with Javascript/dhtml

          "Questman" <questman@UBESU Xthemajorbbs.co m> kirjoitti
          viestissä:a8KKe .191$GE1.39@fe0 7.usenetserver. com...[color=blue]
          > Kimmo Laine wrote:[color=green]
          >>
          >>
          >>
          >> Java Applet might be what you need. Javascript does not provide such
          >> functionality unless... Hmm. You could possibly make an AJAX/CGI
          >> application which would use a serverside script to telnet and
          >> javascript/xmlRequest to display the output to the client. Still, I'd
          >> start making a Java Applet for that if I were you.
          >>[/color]
          >
          > Hi Kimmo,
          >
          > The problem with an Applet is that many browsers turn off the
          > functionality for "security" or performance reasons.
          >
          > Ideally, the goal to get javascript functionality is to have a stock
          > browser be able to access this content.
          >[/color]

          Dude, people turn of Javascript as well. That's like saying you don't like
          Britney Spears but do like Christina Aguilera because Britney is a stupid
          cow. They're both stupid cows! If you want to really have any given browser
          to be able to handle it, using javascript is not going to help you at all.
          With both of them you are between a rock and a hard place.

          The ultimate solution would be to do it like a chat, where you have two
          frames: large top and one row bottom. You type the commands in the bottom
          frame and submit it, and the output appears in the top frame if it's done
          like a chat page. Then the bottom frame just reloads.

          How to do the chat page? You gotta use sme server side programming. The key
          is open the page, but never close it. Keep on streaming the output, send
          some spaces every now and then to keep the connection alive and poll for new
          output. When new output appears like maybe in a text file, stream the
          textfile and delete it. Then start polling again if new text has a ppeared.
          That's like the stupidest thing I've ever written, but it's the solution
          that should work in just about any given browser.

          Here's a pseudo code

          This for the telnet output :

          start_telenet_s ession {
          do while(true) {
          output_availabl e = poll textfile
          if(output_avail able) {
          print output
          clear textfile
          } else {
          sleep 1 second
          print " "
          }
          }
          }


          This is for the bottom frame :

          command_recieve d {
          execute command
          write command output to textfile
          reload same page
          }

          --
          SETI @ Home - Donate your cpu's idle time to science.
          Further reading at <http://setiweb.ssl.ber keley.edu/>
          Kimmo Laine <eternal.erecti onN0@5P4Mgmail. com>


          Comment

          • Nathan White

            #6
            Re: Telnet emulation with Javascript/dhtml

            Yeah there is a open source project that is based off of the work at
            http://sarissa.sourceforge.net/ it is called AnyTerm I believe they
            even support SSH. http://anyterm.org/

            good luck

            Comment

            • Questman

              #7
              Re: Telnet emulation with Javascript/dhtml

              Nathan White wrote:[color=blue]
              > Yeah there is a open source project that is based off of the work at
              > http://sarissa.sourceforge.net/ it is called AnyTerm I believe they
              > even support SSH. http://anyterm.org/
              >
              > good luck
              >[/color]

              THIS IS EXACTLY WHAT I NEEDED.

              Thank you, Nathan.

              Thanks to those who responded - it is much appreciated.

              Rick

              Comment

              Working...