Harikrishnan R
Harikrishnan R

Reputation: 1454

implement a watcher in browser

I have a server on localhost 3000. I want to show the requests coming from a remote application

to this server in a browser . How can I achieve this ?

Upvotes: 0

Views: 127

Answers (1)

Ariejan
Ariejan

Reputation: 11079

Basic long polling solution:

  1. Record the requests from the remote app on your server (e.g. in a database)
  2. Poll with AJAX to fetch any new requests periodically.

Neat HTML5 websockets solution:

  1. Setup a websocket between your server and the browser.
  2. When a request is made, post message to the client over the websocket.

Maybe checkout http://pusherapp.com for more info on websockets.

Upvotes: 2

Related Questions