Remote control

Discussion in 'Java' started by FrenKy, Jun 18, 2008.

  1. FrenKy

    FrenKy Guest

    Hello *,
    I have a network with http proxy, nothing but http and https gets out of
    the intranet to the internet. And I need to make a communication from
    server residing on internet running single proprietary GUI app which
    does NOT implement something like "web client" so I need to pass mouse
    events to the gui (restricted keyboard input)...

    So more descriptive [server]<->[http proxy]<->[client]

    If the proxy is not so restrictive (only passing http traffic) this
    would not be a problem (e.g. Sockets + serialization with compression)
    and Robot class gives me all I need to do this.

    What comes to mind is jsp or jsf on server side + an applet on client
    side, but I'm not fluent with either jsf nor jsp, so I'd be very happy
    if someone would be able to answer following:
    Can I use java.awt.Robot().mouseMove(..) and
    java.awt.Robot().createScreenCapture(..) on the server side (jsp, jsf)
    or in other words, will that code be able to move the mouse on a server
    machine and take a screen shot? I was thinking about using jBoss.

    As you see, this is very, very dumb remote control, but as it is
    oriented to a single app, it should work if I can do that somehow...

    Thanks in advance!
     
    FrenKy, Jun 18, 2008
    #1
    1. Advertising

  2. FrenKy wrote:
    > Hello *,
    > I have a network with http proxy, nothing but http and https gets out of
    > the intranet to the internet. And I need to make a communication from
    > server residing on internet running single proprietary GUI app which
    > does NOT implement something like "web client" so I need to pass mouse
    > events to the gui (restricted keyboard input)...
    >
    > So more descriptive [server]<->[http proxy]<->[client]
    >
    > If the proxy is not so restrictive (only passing http traffic) this
    > would not be a problem (e.g. Sockets + serialization with compression)
    > and Robot class gives me all I need to do this.
    >
    > What comes to mind is jsp or jsf on server side + an applet on client
    > side, but I'm not fluent with either jsf nor jsp, so I'd be very happy
    > if someone would be able to answer following:
    > Can I use java.awt.Robot().mouseMove(..) and
    > java.awt.Robot().createScreenCapture(..) on the server side (jsp, jsf)
    > or in other words, will that code be able to move the mouse on a server
    > machine and take a screen shot? I was thinking about using jBoss.
    >
    > As you see, this is very, very dumb remote control, but as it is
    > oriented to a single app, it should work if I can do that somehow...
    >
    > Thanks in advance!

    From little that I understand of your problem : you might want to look
    at the enterprise edition of realVNC which supports viewer connections
    over HTTP. I have not used this (or even read the documentation
    carefully) so I am not sure if it truly uses HTTP but my guess is that
    it does. The viewer over HTTP is just a java applet so looks like they
    are already doing, in java, what you want to do.
    Abhijat
     
    Abhijat Vatsyayan, Jun 19, 2008
    #2
    1. Advertising

  3. FrenKy

    FrenKy Guest

    Abhijat Vatsyayan wrote:
    > FrenKy wrote:
    >> Hello *,
    >> I have a network with http proxy, nothing but http and https gets out
    >> of the intranet to the internet. And I need to make a communication
    >> from server residing on internet running single proprietary GUI app
    >> which does NOT implement something like "web client" so I need to pass
    >> mouse events to the gui (restricted keyboard input)...
    >>
    >> So more descriptive [server]<->[http proxy]<->[client]
    >>
    >> If the proxy is not so restrictive (only passing http traffic) this
    >> would not be a problem (e.g. Sockets + serialization with compression)
    >> and Robot class gives me all I need to do this.
    >>
    >> What comes to mind is jsp or jsf on server side + an applet on client
    >> side, but I'm not fluent with either jsf nor jsp, so I'd be very happy
    >> if someone would be able to answer following:
    >> Can I use java.awt.Robot().mouseMove(..) and
    >> java.awt.Robot().createScreenCapture(..) on the server side (jsp, jsf)
    >> or in other words, will that code be able to move the mouse on a
    >> server machine and take a screen shot? I was thinking about using jBoss.
    >>
    >> As you see, this is very, very dumb remote control, but as it is
    >> oriented to a single app, it should work if I can do that somehow...
    >>
    >> Thanks in advance!

    > From little that I understand of your problem : you might want to look
    > at the enterprise edition of realVNC which supports viewer connections
    > over HTTP. I have not used this (or even read the documentation
    > carefully) so I am not sure if it truly uses HTTP but my guess is that
    > it does. The viewer over HTTP is just a java applet so looks like they
    > are already doing, in java, what you want to do.
    > Abhijat
    >

    Noup... As far as I understood the documentation they connect to real
    vnc server, only using applet rather than standalone app. And java
    viewer can also be ran as a standalone app. So, binary data transfered
    not http.

    In a meanwhile, I found small web server
    (http://java.sun.com/developer/technicalArticles/Networking/Webserver/WebServer.java)
    removed what I do not need so that it now accepts only requests for one
    file and few command sequences encapsulated as http url and passed to it
    from the applet :) If need be, I can add this http functionality to
    QuickServer and be happy with that.
    Peace of cake, two hours of work, and it does the trick.


    Thanks for the answer though.
     
    FrenKy, Jun 19, 2008
    #3
  4. FrenKy wrote:
    > Abhijat Vatsyayan wrote:
    >> FrenKy wrote:
    >>> Hello *,
    >>> I have a network with http proxy, nothing but http and https gets out
    >>> of the intranet to the internet. And I need to make a communication
    >>> from server residing on internet running single proprietary GUI app
    >>> which does NOT implement something like "web client" so I need to
    >>> pass mouse events to the gui (restricted keyboard input)...
    >>>
    >>> So more descriptive [server]<->[http proxy]<->[client]
    >>>
    >>> If the proxy is not so restrictive (only passing http traffic) this
    >>> would not be a problem (e.g. Sockets + serialization with
    >>> compression) and Robot class gives me all I need to do this.
    >>>
    >>> What comes to mind is jsp or jsf on server side + an applet on client
    >>> side, but I'm not fluent with either jsf nor jsp, so I'd be very
    >>> happy if someone would be able to answer following:
    >>> Can I use java.awt.Robot().mouseMove(..) and
    >>> java.awt.Robot().createScreenCapture(..) on the server side (jsp,
    >>> jsf) or in other words, will that code be able to move the mouse on a
    >>> server machine and take a screen shot? I was thinking about using jBoss.
    >>>
    >>> As you see, this is very, very dumb remote control, but as it is
    >>> oriented to a single app, it should work if I can do that somehow...
    >>>
    >>> Thanks in advance!

    >> From little that I understand of your problem : you might want to
    >> look at the enterprise edition of realVNC which supports viewer
    >> connections over HTTP. I have not used this (or even read the
    >> documentation carefully) so I am not sure if it truly uses HTTP but my
    >> guess is that it does. The viewer over HTTP is just a java applet so
    >> looks like they are already doing, in java, what you want to do.
    >> Abhijat
    >>

    > Noup... As far as I understood the documentation they connect to real
    > vnc server, only using applet rather than standalone app. And java
    > viewer can also be ran as a standalone app. So, binary data transfered
    > not http.

    I do not understand how you concluded that they do not use http from the
    fact that they use applets as well as java application and that they
    transfer binary data. Also - I just looked up - enterprise edition comes
    with HTTP proxy (see http://www.realvnc.com/products/enterprise/#ophv)
    and costs about $50 or so.

    >
    > In a meanwhile, I found small web server
    > (http://java.sun.com/developer/technicalArticles/Networking/Webserver/WebServer.java)
    > removed what I do not need so that it now accepts only requests for one
    > file and few command sequences encapsulated as http url and passed to it
    > from the applet :) If need be, I can add this http functionality to
    > QuickServer and be happy with that.
    > Peace of cake, two hours of work, and it does the trick.
    >

    Sounds like fun .. how are you painting the user interface, simulating
    button clicks and mouse moves etc. ?
    >
    > Thanks for the answer though.
     
    Abhijat Vatsyayan, Jun 19, 2008
    #4
  5. FrenKy

    FrenKy Guest

    Abhijat Vatsyayan wrote:
    > FrenKy wrote:
    >> Abhijat Vatsyayan wrote:
    >>> FrenKy wrote:
    >>>> Hello *,
    >>>> I have a network with http proxy, nothing but http and https gets
    >>>> out of the intranet to the internet. And I need to make a
    >>>> communication from server residing on internet running single
    >>>> proprietary GUI app which does NOT implement something like "web
    >>>> client" so I need to pass mouse events to the gui (restricted
    >>>> keyboard input)...
    >>>>
    >>>> So more descriptive [server]<->[http proxy]<->[client]
    >>>>
    >>>> If the proxy is not so restrictive (only passing http traffic) this
    >>>> would not be a problem (e.g. Sockets + serialization with
    >>>> compression) and Robot class gives me all I need to do this.
    >>>>
    >>>> What comes to mind is jsp or jsf on server side + an applet on
    >>>> client side, but I'm not fluent with either jsf nor jsp, so I'd be
    >>>> very happy if someone would be able to answer following:
    >>>> Can I use java.awt.Robot().mouseMove(..) and
    >>>> java.awt.Robot().createScreenCapture(..) on the server side (jsp,
    >>>> jsf) or in other words, will that code be able to move the mouse on
    >>>> a server machine and take a screen shot? I was thinking about using
    >>>> jBoss.
    >>>>
    >>>> As you see, this is very, very dumb remote control, but as it is
    >>>> oriented to a single app, it should work if I can do that somehow...
    >>>>
    >>>> Thanks in advance!
    >>> From little that I understand of your problem : you might want to
    >>> look at the enterprise edition of realVNC which supports viewer
    >>> connections over HTTP. I have not used this (or even read the
    >>> documentation carefully) so I am not sure if it truly uses HTTP but
    >>> my guess is that it does. The viewer over HTTP is just a java applet
    >>> so looks like they are already doing, in java, what you want to do.
    >>> Abhijat
    >>>

    >> Noup... As far as I understood the documentation they connect to real
    >> vnc server, only using applet rather than standalone app. And java
    >> viewer can also be ran as a standalone app. So, binary data transfered
    >> not http.

    > I do not understand how you concluded that they do not use http from the
    > fact that they use applets as well as java application and that they
    > transfer binary data. Also - I just looked up - enterprise edition comes
    > with HTTP proxy (see http://www.realvnc.com/products/enterprise/#ophv)
    > and costs about $50 or so.
    >

    I had tried it, it did not work, so I looked at the tight vnc java
    client I was using. But it looks like I was not thorough enough.

    >>
    >> In a meanwhile, I found small web server
    >> (http://java.sun.com/developer/technicalArticles/Networking/Webserver/WebServer.java)
    >> removed what I do not need so that it now accepts only requests for
    >> one file and few command sequences encapsulated as http url and passed
    >> to it from the applet :) If need be, I can add this http functionality
    >> to QuickServer and be happy with that.
    >> Peace of cake, two hours of work, and it does the trick.
    >>

    > Sounds like fun .. how are you painting the user interface, simulating
    > button clicks and mouse moves etc. ?

    I use applet to paint the screen grabbed by Robot. I do not care about
    mouse movement, only about mouse click events for right and left mouse
    button at certain coordinates... Not very generic, but it does this
    specific not very heavy user interactive task (once a day, around noon
    few clicks - 3 minute task if you are eating donut at the time :)).
    But, I think I know what your asking - it is not real time. Refresh is
    by demand and 5s after command has been executed.

    I do have one issue worth mentioning though. Applet always loads cached
    image so I use:
    img_scr = getImage(base, "screenchot.gif?cacheFix=" + Math.random());

    Is there a better way?

    >>
    >> Thanks for the answer though.
     
    FrenKy, Jun 19, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. davidj411
    Replies:
    7
    Views:
    3,286
    Tim Golden
    Oct 8, 2009
  2. Tim Chandler
    Replies:
    0
    Views:
    219
    Tim Chandler
    Oct 7, 2003
  3. Jeff Wood
    Replies:
    7
    Views:
    200
    Jeff Wood
    Oct 18, 2005
  4. Markus Arike
    Replies:
    2
    Views:
    101
    Markus Arike
    Aug 19, 2008
  5. Dayton Jones

    Remote.pm (File::Remote) problem

    Dayton Jones, Mar 1, 2006, in forum: Perl Misc
    Replies:
    9
    Views:
    194
    Dayton Jones
    Mar 3, 2006
Loading...

Share This Page