I am wondering how i can send a command (like 1, 2, 3..etc) from my web app (classic asp/asp.net) web page on my android web browser to a windows computer thats on the same LAN network. Kind of like an instant messenger type of thing so that i can design a web page with buttons and each button would send a command back to the computer.
Is that possible? Or do you know any other alternatives to accomplish this same task?
David
If you are looking at using a web server for each system windows system, then the android app simply calls some webpage with the message. The android app would need to keep calling a particular page for 'new' messages using an ajax request. However there are probably other better was of doing this - but it is possible using this method. Another option is each windows system self hosts their own WCF app which receives messages. You still need some central store to make sure all members get the messages unless they constantly poll each other.
Another alternative (and doesn't require polling) is to utilize sockets and simply stream the data back and forth over a port and keep the connection open.
Related
I have a desktop application and I am using the Process.Start property in this application. Can I somehow send a request to this program over the web?
Note: I cannot install iis or similar things on the device as it is a company computer.
Typically, the desktop application would act as a client here, and contact the server (possibly the same server that runs the web app, possibly a slightly different server intended just for API access). It is possible for a browser application to talk to a desktop application, by having the desktop application install itself as a custom protocol handler - but this may require more permission than you are allowed on the desktop machine, and it is relatively complex. Having the desktop app talk to a server, and the browser app talk to a server, but not directly to each-other: is a simpler setup.
If you mean to do this without any kind of browser session on the same machine, then:
either the desktop app needs to be running as a client, connecting to a server, and listening for messages, or:
the app needs to be a server, and open an inbound TCP/UDP port, to listen for connections/messages
The second option presents much more security issues; in a lot of corporate scenarios, this could be disallowed and blocked by corporate firewalls, or could even have the network security folks arrive at your desk with a cardboard box for your things.
You will need to setup your server somewhere in the internet or inside company LAN.
Desktop app should connect to this server and keep connected, waiting for a data. Or you can check for a new data by a timer, if your scenario allows some delays.
When you need to make a request, you send data to your server (may be including client id or something similar to identify the exact instance of the desktop app).
The server forwards data to the desktop app and then forwards the app's response back to you.
Note: you will not able to connect directly to the desktop client without intermediate server, as most likely the company computer does not have "white" ip and is located behind the company's NAT.
I've a web page that has to be opened only via mobile app with webview (or anything the OS uses).
I found some answer where people say to use HTTP_USER_AGENT to check where the request come from, but user-agent is easy editable during the request, so I'm looking for a safer way to do this.
What could be the best approach in this case?
Thank you
You could create a small mobile app which would only run on the mobile phones that you intend to support and the app would generate some temporary tokens and would POST them to the server. The session in the mobile browser would be registered to a WebSocket channel of the server and would update those tokens in real-time. This way, at least the given app is guaranteed to be run on a phone. And if the app is tied to a single session, then it is highly probable that the session would run on the same phone.
If you want to guarantee it, then you can create a browser extension which would communicate directly with your phone app on OS level.
We have a content management solution and we host files.
Our server side act as a MS WEBDAV server .
Our browser side java script based application shows the files stored in our servers.
Whenever an user click on a document in our browser application , we form the ms office URIs and Local ms office installation opens. Thereafter the DAV communication happens between the local office application and our server side.
Now i want to share some information/state between the local office application and the client side browser which actually helped to open the file.
Is it possible on the browser side to listen to some events generated by office application for e.g. on save ?
Office generates event on save but they remain on the realm of Office products. How to propagate this event to the browser application running ?
I can probably develop a VSTO add in , capture the event, wrap the event to a messsage bus and let my browser application listen to that message bus but this seems pretty complex.
Also i don't have the option to send any notification from my server side to client side .
Best Regards,
Saurav
Your best bet is to create a VSTO add-in that talks directly with a server-side service.
You have a few options on how to implement this. I would try to create a WebSocket bridge, which forwards messages between the VSTO add-in and your web application client-side code. I would start by looking at using something like websockify.
Alternatively, you could create a simple HTTP web service that can be called by both parties and then have the javascript code poll for updates periodically.
Or you could even go for a hybrid of these two options, where the VSTO add-in uses a standard HTTP service call and your javascript uses WebSockets to receive updates from the same service.
This new service could easily sit alongside your main web application. Maybe, the web methods could just be part of your web application.
It is quite straight forward... You just need to figure out how you are going to keep a reference of the document so that both parties can refer to it, unmistakenly. I would consider using a file property or document metadata property.
I want to achieve following functionality and need the help for the same:
I have one server on which there is device connected that prints some bar codes based on pre-formatted command given to it.
Currently there is one desktop application which generates the command and does the job.
Now I want to do this via web, meaning there will be one webpage (say .aspx) and I want to achieve this by javascript.
I am able to generate the pre-formatted command required for printing but I don't know how to send the command to server, whether socket tcp ip or something else.
I have tried using node.js, socket.io, json-socket etc. but nothing is working,
If javascript is a fixed requirement, then no I don't think you'll find a direct solution. You will need to create an intermediary service that will translate websocket protocol to the tcp/ip protocol your software communicates on. I found a package called Websockify that has implementations of this kind of bridge in a few different languages.
Although if you are open to using Flash on the front end, and can meet the security requirements on your backend connection, then Flash socket API could work. I believe Java applets can also manage this.
I don't believe this is possible to do from inside a web browser. If it were it would be a huge security vulnerability (think about it, you visit an attackers page and all of a sudden your printer starts printing and every shared directory on your network fills to the brim with junk data).
You could run the command on the server (node/.net/anything else...) and have the web platform talk to the server to kick the process off. But that sounds kind of like what you already have set up...
Alternately, if you can change the software on the connected device you could try to give it an HTTP endpoint which responds to POSTs.
I have a JNLP application that I launch from a HTML/CSS/JS webpage. When the JNLP application reaches a specific point of it's execution, I want to update the information in my webpage.
Is there any good method of communicating with JavaScript during runtime of the JNLP application? For instance to send a message that tells the JavaScript to update/send an ajax request/etc.
I had pretty much the same requirement for my application, and I implemented it with a Comet communication.
Basically your JavaScript should connect to a generated channel per user, and listen to messages on it. Then your Java application, once launched, should open a connection to this channel and broadcast a "I'm ready" message, that the JavaScript application will receive, and then act accordingly.
Good luck, it's not that easy :) More details on http://cometd.org/