-
Dec 13th, 2011, 05:18 PM
#1
[RESOLVED] Want to use browser to communicate with running background executable
I want to use a browser to communicate with running background executable - kind of like how a browser is used to control a sophisticated copier on an office network.
Can I open a web page from a "local" .html file - similar to how my public facing webpages are served up by IIS?
Then once the page is loaded - being that it's jQuery - can I use AJAX to talk to executables running on the same machine? How would the executable open a port that the jQuery ajax could talk to??
-
Dec 13th, 2011, 05:55 PM
#2
Re: Want to use browser to communicate with running background executable
If the executable provides a HTTP interface, you could talk to it using asynchronous GET/POST requests.
If it doesn't, you could build an HTTP interface which acts as a proxy, translating the HTTP requests into commands sent over TCP/IP or whatever other means you have of controlling the service.
Bear in mind that browsers prevent requests from being made across domains (although I forget if any browsers relax this restriction for file:// pages) so whatever HTTP interface you use will have to be served from the same host as the webpage.
-
Dec 13th, 2011, 06:11 PM
#3
Re: Want to use browser to communicate with running background executable
I am in early design stages here - so I'm just looking for good ideas...
I have found JSON to be a great protocol for packing data for transmission - so I started thinking that I would use JSON over TCPIP for communication between my different executables...
Then I thought - why not use a webpage as the console app for these services.
By the "across domain" issue - do you mean I cannot talk from my workstation - using a browser - to a server on the DOMAIN running my executables?
-
Dec 13th, 2011, 06:54 PM
#4
Re: Want to use browser to communicate with running background executable
Originally Posted by szlamany
By the "across domain" issue - do you mean I cannot talk from my workstation - using a browser - to a server on the DOMAIN running my executables?
You can, if the same server that talks to the executable also serves the webpage that you view on your workstation.
AJAX requests must go to the same hostname, protocol, and port as the original webpage.
-
Dec 13th, 2011, 07:44 PM
#5
Re: Want to use browser to communicate with running background executable
Ok - so each executable on whatever server it runs on must serve up the page (is that the HTTP interface??) and that page can talk to the server.
How do I go about making an HTTP interface?
-
Dec 28th, 2011, 03:07 PM
#6
Re: Want to use browser to communicate with running background executable
I used an Httplistener in this thread
http://www.vbforums.com/showthread.p...19#post4110619
Marking this thread closed!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|