In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
In this article, the editor introduces in detail "case analysis of python bullet screen network", with detailed content, clear steps and proper handling of details. I hope that this article "case analysis of python bullet screen network" can help you solve your doubts.
First of all, open the website and click on a live room at random, and of course someone will send out a barrage.
Looking at the on-screen comments and requests, we find that there are not many requests, so let's take a look at ws (websocket)
Click this to clear the record, and then let's refresh the page.
And found a bunch of us to observe one by one.
As we can see, it's all this kind of binary. Let's go into the stack and have a look.
When we reached the breakpoint, we found that his barrage was gone, and after it was released, the barrage rolled out.
Follow this function, this e parameter is handled in this ternary expression, let's continue to look at it.
This.protoLink.isWs ()
Judging by this, we see isWs, and that must be ws, so let's look at the first one.
We look at this function onProto, generally experienced can see that it is a kind of tlv structure, remove on and leave Proto Google open source a pb full name Google Protocol Buffer also referred to as Protobuf, and then we can analyze it step by step, as long as we master the stack method, we can analyze any website at will.
Protocol Buffer
Google Protocol Buffer, also referred to as Protobuf, is a very efficient structured data storage format, which is generally used for the serialization of structured data. To put it simply, it is what we often call data serialization. This serialization protocol is very lightweight, efficient and cross-platform, and currently supports a variety of major languages (version 3.0 supports Cellular, JAVA, Cellular, OC, GO, PYTHON, etc.).
The binary stream data serialized by in this way takes up less space than traditional XML, JSON and other methods, and its parsing efficiency is higher, so it is very good for communication protocols or data storage.
In addition, the way uses is very simple. We only need to define the data format of the good message (message) in advance, and then generate the corresponding files through the compiler provided by it. In those files, we define and implement setter/getter methods that manipulate all the fields of this data structure. We only need to use these methods to set the fields of the data structure. The desired result (binary data stream) can then be obtained through the serialization method.
After reading this, the article "case Analysis of python on-screen comment Network" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, you are welcome to follow the industry information channel.
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.