CPC H04L 63/205 (2013.01) [H04L 9/321 (2013.01); H04L 61/59 (2022.05); H04L 63/0281 (2013.01); H04L 63/0823 (2013.01)] | 16 Claims |
1. A method of data acquisition, comprising:
activating a local server proxy in a preset application program;
in accordance with a determination that the preset application program invokes a preset connection function, acquiring the preset connection function, and replacing a destination address in the preset connection function with a target address corresponding to the local server proxy, to establish a connection between the preset application program and the local server proxy, wherein the preset connection function is a connection function called when the preset application program initiates a network request, the destination address is an address of a remote server with which the preset application program needs to establish a network connection, and the target address is pre-written in the preset application program;
establishing a connection between the local server proxy and a real server corresponding to the target address based on connection information received from the preset application program via the local server proxy; and
acquiring data during a procedure of data forwarding between the real server and the preset application program via the local server proxy,
wherein the method further comprises: before determining that the preset application program invokes the preset connection function,
loading a first core library into the preset application program, wherein the first core library performs centralized management of the invoking of a preset socket by injecting a proxy connection function in the first core library into a second core library, the second core library contains a preset connection function for establishing a connection to the preset socket and
injecting a self-defined connection function into the second core library based on a preset injection approach corresponding to the proxy connection function,
wherein replacing the destination address with the target address comprises:
in accordance with a determination that the preset application program invokes a preset connection function via the second core library, invoking the self-defined connection function instead to replace the destination address of the preset connection function with the target address corresponding to the local server proxy.
|