开发者

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 开发者_StackOverflow社区I achieve this ?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜