UDP (User Datagram Protocol) traffic proxy method and device for browser, equipment and medium

By modifying the network stack and proxy services of the Chromium kernel, the proxy support for the WebRTC protocol UDP traffic is realized, solving the problem that the browser cannot handle UDP traffic through the proxy server, and improving the capabilities and user experience of real-time communication applications.

CN119544676APending Publication Date: 2025-02-28ZIXUN TECHNOLOGY (FUJIAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411443185.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing Chromium kernel browser cannot handle WebRTC's UDP traffic through a proxy server, limiting its application in scenarios such as cross-border communication and privacy protection, resulting in delays and interruptions in real-time video calls.

Method used

By modifying the network stack of the Chromium kernel, adding proxy configuration detection logic, and expanding proxy services, ensuring that UDP traffic is transmitted through the proxy server, realizing proxy support for WebRTC protocol UDP traffic.

Benefits of technology

It solves the problem of not being able to forward WebRTC traffic through the proxy server, improves the browser's application capabilities in real-time communication scenarios, ensures user experience and supports cross-border real-time video calls.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544676A_ABST
    Figure CN119544676A_ABST
Patent Text Reader

Abstract

The invention provides a UDP (User Datagram Protocol) flow proxy method, device, equipment and medium for a browser, the browser is realized based on a Chromium kernel, the method comprises the following steps: modifying a network stack of the Chromium kernel, adding proxy configuration detection logic, ensuring UDP data to pass through a proxy server, and ensuring that a DNS (Domain Name Server) analysis request is sent through the proxy server; the proxy service of the Chromium kernel is expanded, and it is ensured that UDP flow is transmitted through a proxy server; according to the method, normal operation of original functions of the browser is kept, meanwhile, the method that the UDP flow of WebRTC is transmitted through the proxy server can be supported, and the application capacity of the browser in a real-time communication scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technology, and in particular to a method, device, equipment and medium for a UDP flow proxy for a browser. Background Art

[0002] With the development of real-time communication technology, the WebRTC (Web Real-Time Communication) protocol is increasingly used in browsers. WebRTC relies on the UDP protocol to transmit real-time data, such as audio and video streams and data channels. However, existing Chromium-based browsers do not support processing WebRTC UDP traffic through proxies, which limits the use of WebRTC in certain network environments.

[0003] For example, when existing domestic users conduct cross-border real-time video conversations through browsers, they need to access them through proxy service providers. Proxy service providers provide proxy IPs to enable domestic users to conduct real-time video conversations with foreign users. However, existing Chromium-based browsers do not support processing WebRTC UDP traffic through proxies, which limits the use of WebRTC. At this time, Chromium-based browsers can only use HTTP, while users use TCP to transmit HTTP data through proxy IPs. TCP transmission will not retransmit data only when it is certain that the other party has received the data. This results in a large amount of delay in the real-time video conversation, which makes the user experience very poor. In severe delays, the video is directly interrupted, which is inconvenient for users.

[0004] To this end, the existing technology has the following deficiencies: it is impossible to process WebRTC's UDP traffic through a proxy server, which limits its application in scenarios such as cross-border communication and privacy protection. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method, device, equipment and medium for UDP traffic proxy for browsers, which can support the transmission of WebRTC UDP traffic through a proxy server while maintaining the normal operation of the original functions of the browser, thereby improving the application capabilities of the browser in real-time communication scenarios.

[0006] In a first aspect, the present invention provides a method for a UDP traffic proxy for a browser, wherein the browser is a browser implemented based on a Chromium kernel, comprising the following steps:

[0007] Step 1: Modify the network stack of the Chromium kernel and add proxy configuration detection logic to ensure that UDP data passes through the proxy server and that DNS resolution requests are sent through the proxy server;

[0008] Step 2: Expand the proxy service of the Chromium kernel to ensure that UDP traffic is transmitted through the proxy server.

[0009] In a second aspect, the present invention provides a device for a UDP traffic proxy for a browser, comprising:

[0010] The network stack module is used to modify the network stack of the Chromium kernel, add proxy configuration detection logic, ensure that UDP data passes through the proxy server, and ensure that DNS resolution requests are sent through the proxy server;

[0011] The proxy parsing module is used to extend the proxy service of the Chromium kernel and ensure that UDP traffic is transmitted through the proxy server.

[0012] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.

[0013] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0014] One or more technical solutions provided by the present invention have at least the following technical effects or advantages:

[0015] The present invention realizes proxy support for WebRTC protocol UDP traffic by modifying the Chromium kernel, solves the problem in the prior art that WebRTC traffic cannot be forwarded through a proxy server, and has strong practical value and broad application prospects. After the technical solution of the present invention is implemented, it is ensured that the original functions of the browser are not affected in any way.

[0016] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.

[0018] Figure 1 is a flow chart of the method in Embodiment 1 of the present invention;

[0019] Figure 2 It is a schematic diagram of the structure of the device in the second embodiment of the present invention. DETAILED DESCRIPTION

[0020] The embodiments of the present application provide a method, apparatus, device and medium for UDP traffic proxy for browsers, which can support the transmission of WebRTC UDP traffic through a proxy server while maintaining the normal operation of the original functions of the browser, thereby improving the application capabilities of the browser in real-time communication scenarios.

[0021] The technical solution in the embodiment of the present application has the following general idea:

[0022] Modification of the network stack module The present invention first modifies the network stack of the Chromium kernel, specifically including the extension of the P2PSocket and HostResolver classes. P2PSocket is the main class for processing peer-to-peer communication in WebRTC, and is responsible for the transmission of UDP data. By adding proxy configuration detection logic in the P2PSocket::Send() method; the detection logic is: if the Chromium kernel has started proxy forwarding, the peer-to-peer traffic is also sent to the proxy module (the ProxyService class below), so that the UDP traffic of WebRTC can pass through the proxy server during transmission. At the same time, modify the Resolve() method in the HostResolver module, send the DNS resolution request to the proxy module (the ProxyService class below), and ensure that the DNS resolution request is sent through the proxy server to ensure that the STUN and TURN server resolution in WebRTC is completed through the proxy.

[0023] Modification of the Proxy Resolution Module In order to enable the proxy server to process the UDP traffic of WebRTC at the same time, the present invention extends the proxy service module of Chromium. Specifically, the ProxyConfig proxy configuration of the ProxyService class is modified to allow incoming UDP traffic. In the ProxyResolutionService, if the traffic type is UDP, the UDP proxy standard is used to send the UDP traffic to the proxy server to ensure that the WebRTC traffic does not affect other traffic when it is transmitted through the proxy server.

[0024] The sample code for sending UDP traffic is as follows:

[0025]

[0026]

[0027]

[0028]

[0029]

[0030]

[0031] Modification of user interface and configuration In order to enable users to configure the UDP proxy of WebRTC, the present invention modifies the user proxy configuration interface of Chromium. In the chrome: / / settings page, a setting option for the WebRTC UDP proxy server is added, allowing users to enter and save the address and port of the proxy server. By extending the PrefService and ProxyPrefs modules, it is ensured that the proxy settings configured by the user can be correctly saved and take effect when the browser is started.

[0032] After using the above method, users can use the browser to make real-time video calls with overseas users through the proxy server.

[0033] Embodiment 1

[0034] like Figure 1 As shown, this embodiment provides a method for UDP traffic proxy for a browser, wherein the browser is a browser implemented based on a Chromium kernel, and comprises the following steps:

[0035] Step 1: Modify the network stack of the Chromium kernel and add proxy configuration detection logic to ensure that UDP data passes through the proxy server and that DNS resolution requests are sent through the proxy server;

[0036] Step 2: Expand the proxy service of the Chromium kernel to ensure that UDP traffic is transmitted through the proxy server.

[0037] In this embodiment, preferably, the step 1 specifically includes: modifying the network stack of the Chromium kernel of the browser, specifically including extending the P2PSocket class and the HostResolver class; the P2PSocket is a class for processing peer-to-peer communication in WebRTC, responsible for the transmission of UDP data; by adding proxy configuration detection logic in the P2PSocket::Send() method; the detection logic is: if the Chromium kernel has started proxy forwarding, the peer-to-peer traffic is sent to the ProxyService class, so that the UDP traffic of WebRTC passes through the proxy server during the transmission process;

[0038] At the same time, modify the Resolve() method in the HostResolver class to send the DNS resolution request to the ProxyService class to ensure that the DNS resolution request is sent through the proxy server to ensure that the STUN and TURN server resolution in WebRTC is completed through the proxy server.

[0039] In this embodiment, preferably, the step 2 specifically includes: extending the proxy service module of the Chromium kernel; modifying the ProxyConfig proxy configuration of the ProxyService class to allow incoming UDP traffic;

[0040] In ProxyResolutionService, if the traffic type is UDP, the UDP traffic is sent to the proxy server using the UDP proxy standard to ensure that the UDP traffic does not affect other traffic when it is transmitted through the proxy server.

[0041] This embodiment preferably also includes step 3, modifying the user agent configuration interface of the browser, adding a setting option for the UDP proxy server in the chrome: / / settings page, for the user to input and save the address and port of the proxy server; by extending the PrefService class and the ProxyPrefs class, ensuring that the configured proxy settings can be correctly saved and take effect when the browser is started.

[0042] Based on the same inventive concept, the present application also provides a device corresponding to the method in Example 1, see Example 2 for details.

[0043] Embodiment 2

[0044] like Figure 2 As shown, in this embodiment, a device for UDP traffic proxy for a browser is provided, including:

[0045] The network stack module is used to modify the network stack of the Chromium kernel, add proxy configuration detection logic, ensure that UDP data passes through the proxy server, and ensure that DNS resolution requests are sent through the proxy server;

[0046] The proxy parsing module is used to extend the proxy service of the Chromium kernel and ensure that UDP traffic is transmitted through the proxy server.

[0047] In this embodiment, preferably, the network stack module specifically comprises: modifying the network stack of the Chromium kernel of the browser, specifically including extending the P2PSocket class and the HostResolver class; the P2PSocket is a class for processing peer-to-peer communication in WebRTC, responsible for the transmission of UDP data; by adding proxy configuration detection logic in the P2PSocket::Send() method; the detection logic is: if the Chromium kernel has started proxy forwarding, the peer-to-peer traffic is sent to the ProxyService class, so that the UDP traffic of WebRTC passes through the proxy server during the transmission process;

[0048] At the same time, modify the Resolve() method in the HostResolver class to send the DNS resolution request to the ProxyService class to ensure that the DNS resolution request is sent through the proxy server to ensure that the STUN and TURN server resolution in WebRTC is completed through the proxy server.

[0049] In this embodiment, preferably, the proxy parsing module specifically includes: extending the proxy service module of the Chromium kernel; modifying the ProxyConfig proxy configuration of the ProxyService class to allow incoming UDP traffic;

[0050] In ProxyResolutionService, if the traffic type is UDP, the UDP traffic is sent to the proxy server using the UDP proxy standard to ensure that the UDP traffic does not affect other traffic when it is transmitted through the proxy server.

[0051] This embodiment preferably also includes an interface configuration module for modifying the user proxy configuration interface of the browser, adding a setting option for the UDP proxy server in the chrome: / / settings page, for the user to input and save the address and port of the proxy server; by extending the PrefService class and the ProxyPrefs class, ensuring that the configured proxy settings can be correctly saved and take effect when the browser is started.

[0052] Since the device introduced in the second embodiment of the present invention is a device used to implement the method of the first embodiment of the present invention, those skilled in the art can understand the specific structure and deformation of the device based on the method introduced in the first embodiment of the present invention, so it is not described here in detail. All devices used in the method of the first embodiment of the present invention belong to the scope of protection of the present invention.

[0053] Based on the same inventive concept, the present application provides an electronic device embodiment corresponding to the first embodiment, see the third embodiment for details.

[0054] Embodiment 3

[0055] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any implementation method in the first embodiment can be implemented.

[0056] Since the electronic device introduced in this embodiment is a device used to implement the method in the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, a person skilled in the art can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not described in detail here. As long as a person skilled in the art implements the device used by the method in the embodiment of the present application, it belongs to the scope of protection of the present application.

[0057] Based on the same inventive concept, the present application provides a storage medium corresponding to the first embodiment, see the fourth embodiment for details.

[0058] Embodiment 4

[0059] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any implementation method in the first embodiment can be implemented.

[0060] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0061] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0062] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0063] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0064] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A method for UDP traffic proxy for a browser, characterized in that: The browser is a browser implemented based on the Chromium kernel, comprising the following steps: Step 1: Modify the network stack of the Chromium kernel and add proxy configuration detection logic to ensure that UDP data passes through the proxy server and that DNS resolution requests are sent through the proxy server; Step 2: Expand the proxy service of the Chromium kernel to ensure that UDP traffic is transmitted through the proxy server.

2. A method for UDP traffic proxy for a browser according to claim 1, characterized in that: The step 1 is specifically as follows: Modify the network stack of the Chromium kernel of the browser, including the extension of the P2PSocket class and the HostResolver class; the P2PSocket is a class in WebRTC that handles peer-to-peer communication and is responsible for the transmission of UDP data; add proxy configuration detection logic in the P2PSocket::Send() method; the detection logic is: if the Chromium kernel has started proxy forwarding, send the peer-to-peer traffic to the ProxyService class, so that the UDP traffic of WebRTC passes through the proxy server during transmission; At the same time, modify the Resolve() method in the HostResolver class to send the DNS resolution request to the ProxyService class to ensure that the DNS resolution request is sent through the proxy server to ensure that the STUN and TURN server resolution in WebRTC is completed through the proxy server.

3. The method for UDP traffic proxy for a browser according to claim 1, characterized in that: The step 2 specifically includes: extending the proxy service module of the Chromium kernel; modifying the ProxyConfig proxy configuration of the ProxyService class to allow incoming UDP traffic; In ProxyResolutionService, if the traffic type is UDP, the UDP traffic is sent to the proxy server using the UDP proxy standard to ensure that the UDP traffic does not affect other traffic when it is transmitted through the proxy server.

4. The method for a UDP traffic proxy for a browser according to claim 1, characterized in that: It also includes step 3, modifying the user agent configuration interface of the browser, adding a setting option for the UDP proxy server in the chrome: / / settings page, for the user to input and save the address and port of the proxy server; by extending the PrefService class and the ProxyPrefs class, ensuring that the configured proxy settings can be correctly saved and take effect when the browser is started.

5. A device for UDP traffic proxy for a browser, characterized in that: include: The network stack module is used to modify the network stack of the Chromium kernel, add proxy configuration detection logic, ensure that UDP data passes through the proxy server, and ensure that DNS resolution requests are sent through the proxy server; The proxy parsing module is used to extend the proxy service of the Chromium kernel and ensure that UDP traffic is transmitted through the proxy server.

6. The device for UDP traffic proxy for browser according to claim 5, characterized in that: The network stack module specifically includes: modifying the network stack of the Chromium kernel of the browser, specifically including the extension of the P2PSocket class and the HostResolver class; the P2PSocket is a class that handles peer-to-peer communication in WebRTC and is responsible for the transmission of UDP data; by adding proxy configuration detection logic in the P2PSocket::Send() method; the detection logic is: if the Chromium kernel has started proxy forwarding, then the peer-to-peer traffic is sent to the ProxyService class, so that the UDP traffic of WebRTC passes through the proxy server during the transmission process; At the same time, modify the Resolve() method in the HostResolver class to send the DNS resolution request to the ProxyService class to ensure that the DNS resolution request is sent through the proxy server to ensure that the STUN and TURN server resolution in WebRTC is completed through the proxy server.

7. The device for UDP traffic proxy for browser according to claim 5, characterized in that: The proxy parsing module specifically includes: extending the proxy service module of the Chromium kernel; modifying the ProxyConfig proxy configuration of the ProxyService class to allow incoming UDP traffic; In ProxyResolutionService, if the traffic type is UDP, the UDP traffic is sent to the proxy server using the UDP proxy standard to ensure that the UDP traffic does not affect other traffic when it is transmitted through the proxy server.

8. The device for UDP traffic proxy for browser according to claim 5, characterized in that: It also includes an interface configuration module, which is used to modify the browser's user agent configuration interface. In the chrome: / / settings page, a UDP proxy server setting option is added for users to enter and save the address and port of the proxy server; by extending the PrefService class and the ProxyPrefs class, it ensures that the configured proxy settings can be saved correctly and take effect when the browser is started.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.