Title: WordPress and Websockets
Last modified: August 20, 2016

---

# WordPress and Websockets

 *  [Eric Mann](https://wordpress.org/support/users/ericmann/)
 * (@ericmann)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/wordpress-and-websockets/)
 * I asked this over at the [WordPress Stackexchange](http://wordpress.stackexchange.com/questions/28917/can-wordpress-be-made-to-support-websockets),
   but wanted to get some feedback here as well …
 * [Websockets](http://en.wikipedia.org/wiki/WebSocket) are a cool, cutting-edge
   technology wrapped into HTML5. Basically, you can open a websocket to enable 
   persistent, 2-way communication with a web server. The client (user interface)
   can spontaneously send messages, and the server can send messages too.
 * [Existing technology](http://en.wikipedia.org/wiki/Long_polling#Long_polling)(
   JavaScript) requires everything to be started by the client – the server can’t
   send anything to the client that the client hasn’t requests. So scripts need 
   to be constantly refreshing and re-requesting data that might not have changed.
   Websockets work more on a “[push](http://en.wikipedia.org/wiki/Push_technology)”
   basis and let new data come down the pipe whenever.
 * Unfortunately, most (all I can find, anyway) websocket implementations require
   a specific server application to work. People will run Apache on ports 80 and
   443 (http and https) and run another system (typically Node.js) on another port(
   i.e. 8000 or 8080) to handle websocket requests.
 * This works, obviously, but it’s got some drawbacks.
 * I have a plugin I want to build that would greatly benefit from using websockets
   within WordPress. But if a user needs to install a second web server (usually
   impossible for people with shared hosting), then it won’t work as a plugin.
 * So, for any of you who have experience, how would you make WordPress compatible
   with websockets? Would you make WordPress handle the communication itself, or
   bundle another mini-server script into the plugin? If you’ve done this already,
   how did you accomplish it without breaking WordPress itself?
 * Possible resources?
    - [Extendible Web Socket Server](https://github.com/wkjagt/Extendible-Web-Socket-Server)
    - [PHP Websocket](https://github.com/nicokaiser/php-websocket)
    - [PHP and Websockets](http://code.google.com/p/phpwebsocket/)

The topic ‘WordPress and Websockets’ is closed to new replies.

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [html5](https://wordpress.org/support/topic-tag/html5/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 0 replies
 * 1 participant
 * Last reply from: [Eric Mann](https://wordpress.org/support/users/ericmann/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/wordpress-and-websockets/)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
