Home > front end >  Server how to take the initiative to give the client sends the message?
Server how to take the initiative to give the client sends the message?

Time:09-21

Please use flask framework to build the web server how to take the initiative to give the client sends the message? Such as I have A LAN chat web site, the client send A message to A server, A server to send this message to B, server how to take the initiative to client B sends A message?

HTTP is not the client to the server sends the request? How to solve this problem?

CodePudding user response:

Websocket?

CodePudding user response:

reference 1st floor horizon_zpy response:
websocket?

Websocket is no ordinary Internet connection? What I want is the kind of the HTTP protocol

CodePudding user response:

The Http protocol is one-way, cannot push messages, there are several ways before the websocket appeared, but trouble, websocket is the most convenient,
Websocket is just an agreement from the server, of course, to chat, also need to develop server-side code, can try this, chat web end websocket example,
https://blog.csdn.net/pcwe2002/article/details/105696323

CodePudding user response:

HTTP if can use the Transfer - Encoding: chunked, as long as the logo data without end can maintain a long connection, have data to send, as is the case, have seen before, now mostly use the ws,

CodePudding user response:

reference pcwe2002 reply: 3/f
Http protocol is one-way, cannot push message, before the websocket appeared some ways, but trouble, websocket is the most convenient,
Websocket is just an agreement from the server, of course, to chat, also need to develop server-side code, can try this, chat web end websocket example,
https://blog.csdn.net/pcwe2002/article/details/105696323

You this article... Not to access the database

CodePudding user response:

reference pcwe2002 reply: 3/f
Http protocol is one-way, cannot push message, before the websocket appeared some ways, but trouble, websocket is the most convenient,
Websocket is just an agreement from the server, of course, to chat, also need to develop server-side code, can try this, chat web end websocket example,
https://blog.csdn.net/pcwe2002/article/details/105696323

Thank you, I go to search the, learning
  •  Tags:  
  • Ajax
  • Related