# Other Languages > jQuery >  [RESOLVED] Want to use browser to communicate with running background executable

## szlamany

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??

----------


## penagate

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.

----------


## szlamany

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?

----------


## penagate

> 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.

----------


## szlamany

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?

----------


## szlamany

I used an Httplistener in this thread

http://www.vbforums.com/showthread.p...19#post4110619

Marking this thread closed!

----------

