In 2017 real-time web app is only about a WebSockets (WS). It's easy to use in browser, however, setting up a server for some people might be an issue.
There is also something called WAMP (Web Application Messaging Protocol) (do not confuse with WAMP server), it's a WebSocket sub-protocol which allows you to do pub/sub, auth and other stuff.
On the Implementations page you may find many libraries in different languages. In JS one of the most popular is Autobahn.js. Problem here is the size of code and a lot of extra complexity.
Another problem is, many servers doesn't support WAMP v2 or even WAMP v1 and using plain WebSockets is a much easier and safer way. For PHP I would recommend Ratchet based on ReactPHP
I am currently working for BunnyJS simple standard for plain WebSockets communication which allows pub/sub without WAMP and big libraries like Autobahn. It's gonna be a simple JSON communication standard and client-side JS component is very small. Server push also is implemented easily, server just connects to WS server, WS server detects host 127.0.0.1 and thus doesn't adds a connection to clients array.
Each message (both sent from client to server and from server to client) must have type property which can be, for example, SUBSCRIBE altogether with channel name and data key might store all user data.
WebSocket server also should not do any complicated job, it only transfers data from client to client or from server to client (push). You have main web server, you have stand alone small worker which listens for websockets and you have client which connects to websocket server after connecting to web server. When user created a new post and you want to display a notification, server handles writing itself and only does a push to websocket server transferring small amount of data, then websocket server transfers that information to all related clients (for example all connections subscribed to specific channel)