Abstract:Polling pull strategy, which is widely used in traditional web communication system, has some problems, such as low real-time, heavy consumption of network resource and poor scalability. To solve these problems, much research about long connection technology in WebSocket has been done in the paper. Combining WebSocket with MQTT protocol, a new web instant messaging solution based on pub/sub model was proposed to replace polling strategy with push strategy. The formation design of IM and notification message was described in detail. And agent model was proposed for notification message. Meanwhile, a pre-subscription scheme was put forward to decrease net resource consumption further. Moreover, a comparative analysis on delay, bandwidth consumption between the solution and a current popular way bosh+xmpp was done to verify the advantages of the solution.