Method and system for intercepting web page data
A web page data and data packet technology, applied in the field of communication, can solve the problems of high development and maintenance cost, incompatibility, stuck and other problems, and achieve the effect of low development and maintenance cost and good compatibility.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0032] In Embodiment 1, the method for intercepting web page data includes the above-mentioned figure 1 All steps of the processing method shown, wherein, such as figure 2 As shown, step S120 specifically includes the following steps:
[0033] S121: Parsing out a key field for identifying the HTTP request from the protocol header of the HTTP request.
[0034] Wherein, the key fields include: a URL (Uniform Resource Locator, Uniform Resource Locator) field and a submitter (Referer) field.
[0035] S122: Determine whether the HTTP request needs to be intercepted according to the key field.
[0036] Among them, the key field can be used to query the interception rule base. If the rule in the interception rule base is hit, it is judged that the HTTP request needs to be intercepted. If the rule in the interception rule base is not hit, it is judged that the HTTP request does not need to be intercepted. ask.
[0037] Optionally, in order to improve the efficiency of querying th...
Embodiment 2
[0039] In embodiment 2, the method for intercepting webpage data includes the above-mentioned figure 1 All steps of the processing method shown, wherein, such as image 3 As shown, step S130 specifically includes the following steps:
[0040] S131: According to the Ethernet data packet structure, the interception return packet containing the HTTP response with a content length of 0 is set, wherein the interception return packet is provided with a notification TCP / IP (Transmission Control Protocol / Internet Protocol, Transmission Control Protocol / Internet Protocol ) protocol closes the first marker of the TCP (Transmission Control Protocol, Transmission Control Protocol) connection corresponding to the HTTP request and the second marker indicating that the TCP / IP protocol is notified to upload data to the application layer.
[0041] Wherein, the data refers to data transmitted from the TCP layer to the application layer in a general sense.
[0042] S132: Send the interception ...
Embodiment 3
[0045] In Embodiment 3, taking the web page data to be intercepted as a web page advertisement as an example, the method for intercepting web page data is described, as Figure 4 , the method specifically includes the following steps:
[0046] S210: Initialize the WinPcap driver module. This step does not need to be performed every interception, for example, it may be performed once when the method for intercepting web page data is started for the first time.
[0047] Specifically, the WinPcap protocol layer network card driver is installed and initialized, the working mode of the WinPcap driver is set, and an interface is provided for subsequent sending and receiving of data packets.
[0048] S220: Load an ad blocking rule base.
[0049] Wherein, the advertisement blocking rule base defines a set of advertisement URL rules. In order to improve the efficiency of subsequently querying the rule base, the advertisement blocking rule base may be loaded into the memory first, an...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


