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:
- Record the requests from the remote app on your server (e.g. in a database)
- Poll with AJAX to fetch any new requests periodically.
Neat HTML5 websockets solution:
- Setup a websocket between your server and the browser.
- When a request is made, post message to the client over the websocket.
Maybe checkout http://pusherapp.com for more info on websockets.
精彩评论