websocket - Remote Control for Website -


i want start create website opened on mobile phone (any kind of smartphone). website have feature control website have opened on computer. (the volkswagen new century beetle 2011 had feature, scroll via smartphone on website opened on desktop computer)

we have streaming website horsevideos, , awesome feature our customers, if watch streams on smart tv , control via iphone/android/wp.

also wilmaa.com switzerland provides remote control smartphone navigate on website on smart tv/webbrowser.

because need starting point learn how works checking google, maybe there remote controls outside, unfortunately couldn't find anything.

maybe stack overflow can me giving starting points on how realize this.

to need kind of 'pushing' service able overcome inherent drawback of http has been 'pull only' system - client initiates request, server answers. in case want push event server client.

for past years has been done called 'long polling'. means 'abuse' mechanism present in browsers protects server hanging requests, allows them take while. apache default configured allow request last 300 seconds on platforms. long polling works sending ajax request, , if server has no data, instead of sending waits, until either does have data, or long period such minute has expired. client not send new request until has received response. gives illusion end user of real time feedback, , how sites facebook et al have done years.

since few months it's possible employ new html5 technology has stable implementations on major browsers: websockets. technology allows server upgrade common pull request full bidirectional connection, allowing realtime communication between browser , server. regrettably, 'regular' webservers such apache not built kind of logic, although possible emulate frameworks ratchet. realtime part of system current platform of choice sites, including stack overflow here, node.js - serverside asynchronous javascript.

what recommend in situation:

  • set separate node.js server event dispatcher (you can cheap micro sized ec2 instance @ amazon $15 per month suffice, , scalable)
  • keep other code in regular environment now, add logic communicate event dispatcher
  • deploy socket.io websocket handling service. simplifies javascript logic on both server , client side, , wraps realtime connection in such way it's compatible ie5.5, gracefully degrading towards technologies supported both server , client - websockets on recent browsers, long polls or other technologies on legacy systems.

with solution can implement, relatively little code, system full realtime responsiveness across multiple platforms described.

as controlling app itself, use html5, phonegap if intend distribute app stores.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -