How to communicate a web app with destkop app?

Hi everyone,

I need that my web app talk with a dektop application.

User case: a user click a button on the page, and this button send a
command to the desktop app and wait for the answer from destkop app or
timeout.

I am using Rails 4 and Qt/C++, but it is not mandatory to use Qt/C++.
The desktop app is used to talk with computer usb port.

Anyone hava any tips or help?
Thanks

Does is it an alternative for you?

https://wiki.mozilla.org/WebAPI/WebUSB

Without the desktop layer, in this case.


Fernando A.
fernandoalmeida.net http://www.fernandoalmeida.net
adminfinanceiro.com.br http://www.adminfinanceiro.com.br

2013/9/24 Ricardo do Valle [email protected]

On 24 September 2013 19:44, Ricardo do Valle [email protected]
wrote:

Hi everyone,

I need that my web app talk with a dektop application.

Which computer is the web application running on (not the browser, the
rails server)?

Colin

Ricardo do Valle wrote in post #1122365:

@Colin the rails server is running in a VPS with nginx and unicorn.

@Fernando, thank you very much, but it is not alternative for this
project,
i will study the chrome devs API for a future and another project, have
you
used already?

I am looking for a way to create sockets and controls (state machine)
from
a rails app or another way to do that.

You do realize that what you’re talking about here is VERY DANGEROUS.
Web browsers work very hard to prevent exactly what you’re describing
here. This is the reason why JavaScript is sandboxed and provided no
access outside of the browser environment.

That being said, you could write your own browser plugin and do whatever
you want. Of course, you will then be exposing anyone dumb enough to
install your plugin to all the sorts of security holes that ActiveX
based browser plugins, among others, became famous for.

If I were in your shoes I would instead write native applications that
communicate with your Rails application via web services. A good example
of this is the Pivotal Tracker app for iPhone and iPad.

This way you can ask people, that have some trust in you, to install
your native application. It will then communicate directly to your Rails
application and leave the user’s browser environment secure and free
from “drive-by” security vulnerabilities.

@Colin the rails server is running in a VPS with nginx and unicorn.

@Fernando, thank you very much, but it is not alternative for this
project,
i will study the chrome devs API for a future and another project, have
you
used already?

I am looking for a way to create sockets and controls (state machine)
from
a rails app or another way to do that.

On Tue, Sep 24, 2013 at 5:08 PM, Colin L. [email protected]
wrote:

For more options, visit https://groups.google.com/groups/opt_out.
For more options, visit https://groups.google.com/groups/opt_out.


Ricardo do Valle

Hi @Ricardo, I am not using yet but I already had seen before and
remembered with your post.


Fernando A.
fernandoalmeida.net http://www.fernandoalmeida.net
adminfinanceiro.com.br http://www.adminfinanceiro.com.br

2013/9/25 Ricardo do Valle [email protected]

@Colin, this is possible with ActiveX (Windows + IE only)

In the Firefox I am not sure but I think it is possible if the user
explicitly allow, maybe with signed script or some extended permission

https://wiki.mozilla.org/Apps/Security#Extended_permissions


Fernando A.
fernandoalmeida.net http://www.fernandoalmeida.net
adminfinanceiro.com.br http://www.adminfinanceiro.com.br

2013/9/25 Colin L. [email protected]

On 25 September 2013 16:11, Fernando A.
[email protected] wrote:

@Colin, this is possible with ActiveX (Windows + IE only)

Yes that is true, I had rejected that as a possible solution as I
assumed no-one enables ActiveX nowadays due to the security risks, and
the fact that it only works with IE. It may allow the OP do to what
he wants however, but as Robert suggested there are better solutions.
Does the current IE still support ActiveX?

Colin

Yes current IE support ActiveX.

P

On 25 September 2013 05:09, Ricardo do Valle [email protected]
wrote:

@Colin the rails server is running in a VPS with nginx and unicorn.

So the server is running on a different computer to the browser, and
you want a page in the browser to interact with an app on the PC
running the browser. I believe this is not possible, and nor should
it be possible. Would you want a web page to be able to affect
applications running on the PC? Imagine what a malicious website
could do if this were possible.

Colin