简体   繁体   中英

Using a websocket or APE(Ajax Push Engine) technology on a Webhost

I have a question which I can't seem to answer after searching for an answer on google. I have a website hosted on a web host, but I want to introduce some real-time functionality on it, like a real-time notification system, or maybe a chat system.

As I understand the short-polling and long-polling methods of simulating a live feature are kinda obsolete. Today with the modern HTML5, we can use Websockets as I understand, or APE(Ajax Push Engine). The thing is that I don't understand, how do I use websocket or APE on the webhost if they require a server to which they connect in order to work ?

How can I run that server along with my website on the same host ? Or maybe I am missing something ?

Can you give me some information on this problem, that I can read?

Thank you.

WebSocket is just another protocol. It works on port 80, so luckly you don't need a new server.

You just need to implement an abstraction level on your backend (but maybe it can do itself) that gets the HTTP request and looks if there are the upgrade headers.

If the answer is yes, go to websocket code, if not use standard HTTP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM