In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about the example analysis of nginx configuring websocket proxy forwarding and java implementing websocket. Many people may not know much about it. In order to make you understand better, the editor summarizes the following content for you. I hope you can get something according to this article.
Nginx configuration location ~ * / websocket {proxy_pass http://web-servers; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_read_timeout 3600s;} key points
The front end needs to maintain a heartbeat (ping) with the back end during the $proxy_read_timeout time to maintain the session and keep it open when the user has no operation.
Nginx upstream uses the connector "-" instead of an underscore to prevent problems in future versions of tomcat8.5.x
Error during WebSocket handshake: Unexpected response code: some key points of thinking process discussion: 1, identity: client / server, client may be browser or backend; 2, mode: peer-to-peer / broadcast, sending messages to some users filtered through business in specified batches; 3. Several concepts: cookie, http session id, websocket userId, websocket session id 4. Difficulties: websocket session persistence for a long time (nginx proxy forwarding + front-end regular polling of ping), permission issues (whether login is required, whether http session expires is disconnect websocket session, that is, whether websocket depends on the existence of http session), cluster environment server actively pushes the specified client (the established session connection may not be in the local current node) to read the above Do you have any further understanding of nginx's configuration of websocket proxy forwarding and the example analysis of java implementing websocket? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.