CN107948232B - Hook API-based proxy implementation method, data transmission method, device and system - Google Patents

Hook API-based proxy implementation method, data transmission method, device and system Download PDF

Info

Publication number
CN107948232B
CN107948232B CN201610896058.8A CN201610896058A CN107948232B CN 107948232 B CN107948232 B CN 107948232B CN 201610896058 A CN201610896058 A CN 201610896058A CN 107948232 B CN107948232 B CN 107948232B
Authority
CN
China
Prior art keywords
proxy
api
hook
service
destination
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610896058.8A
Other languages
Chinese (zh)
Other versions
CN107948232A (en
Inventor
曾岳锋
张元龙
左鸿绪
郭计伟
陈焕葵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610896058.8A priority Critical patent/CN107948232B/en
Publication of CN107948232A publication Critical patent/CN107948232A/en
Application granted granted Critical
Publication of CN107948232B publication Critical patent/CN107948232B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a proxy implementation method based on Hook API, comprising the steps that first equipment sends a destination IP address and a port number of second equipment to an API library so as to call a function in the API library; establishing connection between the first equipment and a proxy service port of the proxy equipment according to the API library; the API library sends the received destination IP address and the port number of the second device to the proxy device; and the proxy equipment establishes connection with the destination IP address and the port number of the second equipment by using the proxy service port. The invention also provides a data transmission method, a device and a system, the invention is based on the Hook API agent realization method, the data transmission method, the device and the system, the Hook API mode is adopted, and the protocol is adopted to ensure the data transmission between the Hook API and the agent service port of the agent equipment, so that the agent equipment is transparent to both sides of the interactive transmission data, and the protocol between the two transmission ends is not required to be known, thereby being easy to expand, simplifying the agent process, improving the performance and being convenient for operation and maintenance.

Description

Hook API-based proxy implementation method, data transmission method, device and system
Technical Field
The invention relates to the technical field of computers, in particular to a Hook API-based proxy implementation method, a data transmission method, a device and a system.
Background
In a large network cluster, due to the limitation of security policy, data cannot be directly transmitted between different devices, and a data transmission mode from a first device to a second device may become through an intermediate device: the first device transmits data to the intermediate device, which in turn transmits data to the second device, wherein the intermediate device acts as a proxy.
The first is that data is transmitted from a first device to a proxy device, and the proxy device needs to analyze the data first, obtain what service the data being transmitted corresponds to by analyzing the data, and then transmit the data to a corresponding service process on a second device. In the implementation scheme, for a protocol for knowing data interacted between the first device and the second device, the agent device needs to consume CPU calculation for analyzing the data, the management of various protocols is very complex, in addition, the process of capacity expansion and deployment is very troublesome, and the configuration related to the first device and the second device needs to be modified.
The other is that the agent device pre-allocates a plurality of ports, the first device sends data of different protocols to different ports of the agent device, and the agent device forwards the different port request data to different backstage of the second device. The main disadvantages of this method are that the port needs to correspond to the service, the agent is opaque in the design of this system, the port needs to correspond to the service, and the operation and maintenance are inconvenient.
Disclosure of Invention
In view of this, the invention provides a Hook API-based proxy implementation method, a data transmission method, a device and a system, which are easy to expand, can simplify the proxy process, improve the performance, and are convenient to operate and maintain.
The embodiment of the invention provides a proxy realization method of Hook API, comprising the steps that first equipment sends a destination IP address and a port number of second equipment to an API library so as to call a function in the API library; establishing connection between the first equipment and a proxy service port of the proxy equipment according to the API library; the API library sends the received destination IP address and the port number of the second device to the proxy device; and the proxy equipment establishes connection with the destination IP address and the port number of the second equipment by using the proxy service port.
The embodiment of the invention also provides a data transmission method, which comprises the above Hook API proxy realization method and the proxy service port of the proxy device receiving the data sent by the first device and forwarding the data to the destination IP address and port number of the second device.
The embodiment of the invention also provides a proxy implementation method based on Hook API, which is applied to an API library and comprises the steps of receiving the destination IP address and the port number of the second equipment sent by the first equipment; and enabling the first device to establish connection with a proxy service port of the proxy device, and sending the destination IP address and the port number of the second device to the proxy device, so that the proxy service port of the proxy device establishes connection with the destination IP address and the port number of the second device.
The embodiment of the invention also provides a Hook API-based proxy implementation system, which comprises first equipment, an API library, proxy equipment and second equipment; the first device sends a destination IP address and a port number of the second device to the API library so as to call a function in the API library; the API library is used for enabling the first equipment to establish connection with a proxy service port of proxy equipment and sending the received destination IP address and port number of the second equipment to the proxy equipment; the proxy device is used for establishing connection with the destination IP address and the port number of the second device by using the proxy service port.
The embodiment of the invention also provides a proxy implementation device based on the Hook API, which is applied to an API library and comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving the destination IP address and the port number of the second equipment sent by the first equipment; the connection module is used for enabling the first equipment to establish connection with a proxy service port of proxy equipment; and the sending module is used for sending the destination IP address and the port number of the second equipment to the proxy equipment so as to enable the proxy service port of the proxy equipment to establish connection with the destination IP address and the port number of the second equipment.
According to the Hook API-based proxy implementation method, the data transmission device and the system, the proxy equipment is transparent to the first equipment and the second equipment in a Hook API mode, and the two parties for data interaction transmission do not know the existence of the proxy equipment, so that the capacity expansion and deployment of the proxy equipment are very convenient. In addition, the proxy service is set in the proxy equipment, and the data transmission between the Hook API and the proxy service port of the proxy equipment is ensured by a protocol, so that the data transmitted to the proxy equipment can be accurately transmitted to the destination port of the opposite terminal equipment without knowing the protocol between the two transmission ends, the proxy design is simplified, the performance can be greatly improved, and the operation and maintenance are convenient.
In order to make the aforementioned and other objects, features and advantages of the invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
Fig. 1 is an application environment diagram of a Hook API-based proxy implementation method, a data transmission method, an apparatus and a system according to an embodiment of the present invention;
FIG. 2 shows a block diagram of a server;
FIG. 3 is a flowchart of a Hook API-based proxy implementation method according to a first embodiment of the present invention;
FIG. 4 is a flowchart of a Hook API-based proxy implementation method according to a second embodiment of the present invention;
FIG. 5 is a flowchart of a Hook API-based proxy implementation method according to a third embodiment of the present invention;
FIG. 6 is a block diagram of a Hook API based proxy implementation system according to a fourth embodiment of the present invention;
fig. 7 is a structural diagram of a Hook API-based proxy implementation apparatus according to a fifth embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The method, the device and the system for realizing the proxy based on the Hook API provided by the embodiments of the invention can be applied to the application environment shown in figure 1 to realize cross-device data transmission. As shown in fig. 1, the first device 100, the API library 200, the proxy device 300, and the second device 400 are located in a wireless network or a wired network through which the first device 100, the API library 200, the proxy device 300, and the second device 400 perform data interaction.
The first device 100 and the second device 400 may both include a server, and may also include a Personal Computer (PC), an all-in-one machine, a laptop portable Computer, a vehicle-mounted terminal, and other Computer terminal devices, and a mobile terminal device such as a smart phone, a tablet Computer, an electronic book reader, an MP3 player (Moving Picture Experts Group Audio Layer III, motion Picture Experts compression standard Audio Layer 3), an MP4(Moving Picture Experts Group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4), and the like.
The API library 200 may be located remotely or locally to the first device 100.
Preferably, the API library 200 is remotely located, and performs data interaction with the first device 100 and the agent device 300 through a network.
Fig. 2 shows a block diagram of a server. The structure shown in fig. 2 can be applied to the first device 100, the proxy device 300, and the second device 400 at the same time, and as shown in fig. 2, the server includes: memory 301, processor 302, and network module 303.
It will be appreciated that the configuration shown in fig. 2 is merely illustrative and that the server may include more or fewer components than shown in fig. 2 or may have a different configuration than shown in fig. 2. The components shown in fig. 2 may be implemented in hardware, software, or a combination thereof. In addition, the server in the embodiment of the present invention may further include a plurality of servers with different specific functions.
The memory 301 may be configured to store software programs and modules, such as program instructions/modules corresponding to the Hook API-based proxy implementation method, the data transmission method, the apparatus and the system in the embodiment of the present invention, and the processor 302 executes various functional applications and data processing by running the software programs and modules stored in the memory 301, that is, implementing the Hook API-based proxy implementation method in the embodiment of the present invention. The memory 301 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 301 may further include memory located remotely from the processor 302, which may be connected to a server over a network. Further, the software programs and modules may further include: an operating system 321, and a service module 322. The operating system 321, which may be LINUX, UNIX, WINDOWS, for example, may include various software components and/or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components. The service module 322 runs on the basis of the operating system 321, monitors a request from the network through the network service of the operating system 321, completes corresponding data processing according to the request, and returns a processing result to the client. That is, the service module 322 is used to provide web services to clients.
The network module 303 is used for receiving and transmitting network signals. The network signal may include a wireless signal or a wired signal. In one example, the network signal is a wired network signal. At this time, the network module 303 may include a processor, a random access memory, a converter, a crystal oscillator, and the like.
First embodiment
Fig. 3 is a flowchart of a Hook API-based proxy implementation method according to a first embodiment of the present invention. The present embodiment is a Hook API-based proxy implementation method executed by the first device 100, the API library 200, the proxy device 300, and the second device 400 through the network, and may be applied to the environment shown in fig. 1. As shown in fig. 3 and fig. 1, the method for implementing a Hook API-based proxy according to this embodiment may include the following steps:
step S11: the first device 100 transmits the destination IP address and the port number of the second device 400 to the API library 200 to call a function in the API library 200;
specifically, the first device 100 may send the destination IP address and the port number of the second device 400 to be requested to the API library 200 through a wireless network or a wired network according to a trigger instruction input by a user.
Step S12: establishing connection between the first device 100 and a proxy service port of the proxy device 300 according to the API library 200;
step S13: the API library 200 transmits the received destination IP address and port number of the second device 400 to the proxy device 300;
step S12 is not in sequence with step S13, that is, step S13 may be performed before or after step S12. Of course, step S13 and step S12 may be performed simultaneously.
Specifically, the proxy device 300 provides a proxy service corresponding to one IP address and port number.
Taking the IP address and port number 172.168.0.2:1002 corresponding to the proxy service of the proxy device 300 as an example that the first device 100 wants to request 172.168.0.1:1001 service on the second device 400: the API library 200 establishes a connection between the first device 100 and the proxy service port 172.168.0.2:1002 of the proxy device 300, and transmits the destination IP address and the port number 172.168.0.1:1001 of the second device 400 to be requested by the first device 100 to the proxy device 300.
Step S14: the proxy device 300 establishes a connection with the destination IP address and port number of the second device 400 using the proxy service port.
Specifically, the proxy device 300 sends a connection request to the destination IP address and port number of the second device 400, and the second device 400 responds to the connection request after receiving the connection request sent by the proxy device 300, so as to establish a connection with the proxy service port of the proxy device 300.
Specifically, the proxy service port of the proxy device 300 establishes a connection with the destination IP address and port number of the second device 400, for example, the proxy service port 172.168.0.2:1002 of the proxy device 300 establishes a connection with 172.168.0.1:1001 of the second device 400.
The Hook API-based proxy implementation method provided in the embodiment of the present invention makes the proxy device 300 transparent to the first device 100 and the second device 400 through the Hook API, and both sides of the interactive data transmission do not know the existence of the proxy device 300, which makes the expansion and deployment of the proxy device 300 very convenient. In addition, by setting proxy service in the proxy device 300 and by means of ensuring that data transmission between the Hook API and the proxy service port of the proxy device 300 is guaranteed by a protocol, data transmitted to the proxy device 300 can be accurately transmitted to the destination port of the opposite device without knowing the protocol between the two ends of transmission, so that proxy design is simplified, performance can be greatly improved, and operation and maintenance are convenient.
Second embodiment
Fig. 4 is a flowchart of a Hook API-based proxy implementation method according to a second embodiment of the present invention. The present embodiment is a Hook API-based proxy implementation method executed by the first device 100, the API library 200, the proxy device 300, and the second device 400 through the network. As shown in fig. 4, the method for implementing a Hook API-based proxy according to this embodiment may include the following steps:
step S21: adding a proxy configuration file on the first device 100, wherein the proxy configuration file configures the first device 100 to request the service of the second device 400 to be forwarded through a proxy service port of the proxy device 300;
it will be appreciated by those skilled in the art that adding the proxy profile on the first device 100 may also be performed after step S22.
Step S22: the first device 100 transmits the destination IP address and the port number of the second device 400 to the API library 200 to call a function in the API library 200;
specifically, the first device 100 may transmit the destination IP address and the port number of the second device 400 to the API library 200 through a wireless network or a wired network according to a trigger instruction input by a user.
Step S23: the API library 200 reads the agent profile on the first device 100;
step S24: the API library 200 makes the first device 100 establish a connection with a proxy service port of the proxy device 300, and transmits the received destination IP address and port number of the second device 400 to the proxy device 300;
specifically, the proxy device 300 provides a proxy service corresponding to one IP address and port number.
Taking the IP address and port number 172.168.0.2:1002 corresponding to the proxy service of the proxy device 300 as an example that the first device 100 wants to request 172.168.0.1:1001 service on the second device 400: the API library 200 establishes a connection between the first device 100 and the proxy service port 172.168.0.2:1002 of the proxy device 300, and transmits the destination IP address and the port number 172.168.0.1:1001 of the second device 400 to be requested by the first device 100 to the proxy device 300.
Step S25: the proxy device 300 establishes a connection with the destination IP address and port number of the second device 400 using the proxy service port.
Specifically, for example, the proxy device 300 establishes a connection with 172.168.0.1:1001 of the second device 400 using proxy service ports 172.168.0.2: 1002.
Step S26: the proxy service port of the proxy device 300 receives the data transmitted by the first device 100 and forwards the data to the destination IP address and port number of the second device 400.
In the Hook API-based proxy implementation method provided in the embodiment of the present invention, the first device 100 is configured to request that the service of the second device 400 is forwarded through the proxy service port of the proxy device 300, so that the proxy device 300 is transparent to the first device 100 and the second device 400 in a Hook API manner, and both parties interacting with data transmission do not know the existence of the proxy device 300, which makes the expansion and deployment of the proxy device 300 very convenient. In addition, by setting proxy service in the proxy device 300 and by means of ensuring that data transmission between the Hook API and the proxy service port of the proxy device 300 is guaranteed by a protocol, data transmitted to the proxy device 300 can be accurately transmitted to the destination port of the opposite device without knowing the protocol between the two ends of transmission, so that proxy design is simplified, performance can be greatly improved, and operation and maintenance are convenient.
Third embodiment
Fig. 5 is a flowchart of a Hook API-based proxy implementation method according to a third embodiment of the present invention. The embodiment is a Hook API-based proxy implementation method executed by the API library 200 through a network. As shown in fig. 5 and fig. 1, the method for implementing a Hook API-based proxy according to this embodiment may include the following steps:
step S31: receiving a destination IP address and a port number of the second device 400 sent by the first device 100;
step S32: the first device 100 is connected to the proxy service port of the proxy device 300, and the destination IP address and port number of the second device 400 are transmitted to the proxy device 300, so that the proxy service port of the proxy device 300 is connected to the destination IP address and port number of the second device 400.
Further, before step S31, the method may further include reading a proxy profile on the first device 100, where the proxy profile configures the first device 100 to request the service of the second device 400 to be forwarded through a proxy service port of the proxy device 300.
In the Hook API-based proxy implementation method provided in the embodiment of the present invention, the first device 100 is configured to request that the service of the second device 400 is forwarded through the proxy service port of the proxy device 300, so that the proxy device 300 is transparent to the first device 100 and the second device 400 in a Hook API manner, and both parties interacting with data transmission do not know the existence of the proxy device 300, which makes the expansion and deployment of the proxy device 300 very convenient. In addition, by setting proxy service in the proxy device 300 and by means of ensuring that data transmission between the Hook API and the proxy service port of the proxy device 300 is guaranteed by a protocol, data transmitted to the proxy device 300 can be accurately transmitted to the destination port of the second device 400 without knowing the protocol between the two ends of the transmission, so that proxy design is simplified, performance can be greatly improved, and operation and maintenance are also convenient.
The present invention further provides a data transmission method, which includes the Hook API-based proxy implementation method shown in fig. 3, fig. 4, or fig. 5, and please refer to the detailed description of the first embodiment, the second embodiment, and the third embodiment for specific steps, which is not described herein again.
In the data transmission method provided in the embodiment of the present invention, the first device 100 is configured to request the service of the second device 400 to be forwarded through the proxy service port of the proxy device 300, so that the proxy device 300 is transparent to the first device 100 and the second device 400 in a Hook API manner, and two parties interacting with data transmission do not know the existence of the proxy device 300, which makes the capacity expansion and deployment of the proxy device 300 very convenient. In addition, by setting proxy service in the proxy device 300 and by means of ensuring that data transmission between the Hook API and the proxy service port of the proxy device 300 is guaranteed by a protocol, data transmitted to the proxy device 300 can be accurately transmitted to the destination port of the second device 400 without knowing the protocol between the two ends of the transmission, so that proxy design is simplified, performance can be greatly improved, and operation and maintenance are also convenient.
Fourth embodiment
Fig. 6 is a structural diagram of a Hook API-based proxy implementation system according to a fourth embodiment of the present invention. As shown in fig. 6, the Hook API-based proxy implementation system includes a first device 600, an API library 601, a proxy device 602, and a second device 603.
The first device 600 sends the destination IP address and the port number of the second device 603 to be requested to the API library 601, so as to call the function in the API library 601.
The API library 601 is used to establish a connection between the first device 600 and a proxy service port of the proxy device 602, and to transmit the received destination IP address and port number of the second device 603 to the proxy device 602.
Specifically, the first device 600 includes a proxy profile, which configures the first device 600 to request the service of the second device 603 to be forwarded through a proxy service port of the proxy device 602; the API library 601 reads the agent profile on the first device 600.
Wherein the proxy device 602 is configured to establish a connection with a destination IP address and a port number of the second device 603 using the proxy service port.
Further, the proxy device 602 is further configured to receive data sent by the first device 600 through the proxy service port, and forward the data to the destination IP address and port number of the second device 603.
In the Hook API-based proxy implementation system provided in the embodiment of the present invention, the first device 600 is configured to request the service of the second device 603 to be forwarded through the proxy service port of the proxy device 602, so that the proxy device 602 is transparent to the first device 600 and the second device 603 in a Hook API manner, and both parties interacting with data transmission do not know the existence of the proxy device 602, which makes the expansion and deployment of the proxy device 602 very convenient. In addition, by setting proxy service in the proxy device 602 and by means of ensuring that data transmission between the Hook API and the proxy service port of the proxy device 602 is guaranteed by a protocol, data transmitted to the proxy device 602 can be accurately transmitted to the destination port of the second device 603 without knowing the protocol between the two ends of transmission, so that proxy design is simplified, performance can be greatly improved, and operation and maintenance are convenient.
Fifth embodiment
Fig. 7 is a structural diagram of a Hook API-based proxy implementation apparatus according to a fifth embodiment of the present invention. The proxy implementation device based on Hook API is applied to an API library and comprises the following steps: a receiving module 710, a connecting module 720, and a sending module 730.
The receiving module 710 is configured to receive a destination IP address and a port number of the second device sent by the first device. The connection module 720 is configured to enable the first device to establish a connection with a proxy service port of a proxy device. The sending module 730 is configured to send the destination IP address and the port number of the second device to the proxy device, so that the proxy service port of the proxy device establishes a connection with the destination IP address and the port number of the second device.
Further, the Hook API-based proxy implementation apparatus further includes a reading module, where the reading module is configured to read a proxy configuration file on the first device, and the proxy configuration file configures that the first device requests the service of the second device to be forwarded through a proxy service port of the proxy device.
According to the proxy implementation device based on the Hook API, the proxy equipment is transparent to the first equipment and the second equipment in a Hook API mode, and two parties for interactively transmitting data do not know the existence of the proxy equipment, so that the capacity expansion and deployment of the proxy equipment are very convenient. In addition, by setting proxy service in the proxy device 300 and by means of ensuring that data transmission between the Hook API and the proxy service port of the proxy device is guaranteed by a protocol, data transmitted to the proxy device can be accurately transmitted to the destination port of the second device without knowing the protocol between the two ends of the transmission, so that proxy design is simplified, performance can be greatly improved, and operation and maintenance are convenient.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Although the present invention has been described with reference to the preferred embodiments, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (9)

1. A kind of proxy realizing method based on Hook API is characterized in that it includes:
adding an agent configuration file at a first device; the proxy configuration file configures the first device to request the service of the second device to be forwarded through a proxy service port of the proxy device;
for a service which needs to be requested from a second device by the first device, the first device sends a destination IP address and a port number of the second device to an API library located at the far ends of the first device and the second device, and calls a function in the API library by Hook;
wherein the service corresponds to the destination IP address and the port number;
reading the proxy configuration file on the first device according to a function called by Hook in the API library;
establishing connection between the first device and a proxy service port of the proxy device configured in the proxy configuration file according to a function called by Hook in the API library;
data transmission is carried out between the API library of the Hook and the proxy service port of the proxy equipment in a mode of protocol guarantee;
according to a function called by Hook in the API library, the API library sends the received destination IP address and the port number of the second device to the proxy device; and
the proxy equipment establishes connection with the destination IP address and the port number of the second equipment by using the proxy service port;
wherein the connection is for the first device to transmit data to the service in the second device.
2. The Hook API-based proxy implementation method of claim 1, wherein the step of the proxy device establishing a connection with the destination IP address and port number of the second device using a proxy service port is followed by:
and after receiving the data sent by the first device, the proxy service port of the proxy device forwards the data to the destination IP address and the port number of the second device.
3. A method of data transmission, the method comprising:
the Hook API-based proxy implementation method according to any of the claims 1 to 2; and
and the proxy service port of the proxy equipment receives the data sent by the first equipment and forwards the data to the destination IP address and the port number of the second equipment.
4. A kind of proxy implementation method based on Hook API, apply to the API storehouse located in far-end of the first apparatus and second apparatus, characterized by that, including:
receiving a destination IP address and a port number of the second device sent by the first device;
wherein the first device adds an agent profile; wherein the proxy configuration file configures the first device to request the service of the second device to be forwarded through a proxy service port of the proxy device;
wherein the service that the first device needs to request from the second device corresponds to the destination IP address and the port number;
reading the proxy configuration file on the first device according to a function called by Hook in the API library;
according to a function called by Hook in the API library, enabling the first device to establish connection with a proxy service port of the proxy device configured in the proxy configuration file, and sending a destination IP address and a port number of the second device to the proxy device, so that the proxy service port of the proxy device establishes connection with the destination IP address and the port number of the second device;
data transmission is carried out between the API library of the Hook and the proxy service port of the proxy equipment in a mode of protocol guarantee;
wherein the connection is for the first device to transmit data to the service in the second device.
5. A kind of agent based on Hook API realizes the system, characterized by that, said agent based on Hook API realizes the system to include the first apparatus, API storehouse, agent apparatus and second apparatus;
the first device comprises a proxy configuration file, and the proxy configuration file configures the first device to request the service of the second device to be forwarded through a proxy service port of the proxy device; the API library is also used for reading the proxy configuration file on the first device according to the function called by Hook in the API library;
for a service which is required to be requested from a second device by the first device, the first device is used for sending a destination IP address and a port number of the second device to the API library located at the far end of the first device and the second device, and calling a function in the API library by Hook;
wherein the service corresponds to the destination IP address and the port number;
reading the proxy configuration file on the first device according to a function called by Hook in the API library;
the API library is used for establishing connection between the first equipment and the proxy service port of the proxy equipment according to a function called by Hook in the API library, and sending the received destination IP address and port number of the second equipment to the proxy equipment;
data transmission is carried out between the API library of the Hook and the proxy service port of the proxy equipment in a mode of protocol guarantee;
the proxy equipment is used for establishing connection with the destination IP address and the port number of the second equipment by utilizing the proxy service port;
wherein the connection is for the first device to transmit data to the service in the second device.
6. The Hook API-based proxy implementation system according to claim 5, wherein the proxy device is further configured to receive data sent by the first device using a proxy service port and forward the data to a destination IP address and port number of the second device.
7. A kind of proxy implementation device based on Hook API, apply to the API storehouse located in far-end of the first apparatus and second apparatus, characterized by that, the said proxy implementation device based on Hook API includes:
a receiving module, configured to receive a destination IP address and a port number of the second device sent by the first device;
wherein the first device adds an agent profile; wherein the proxy configuration file configures the first device to request the service of the second device to be forwarded through a proxy service port of the proxy device;
wherein the service that the first device needs to request from the second device corresponds to the destination IP address and the port number;
the connection module is used for reading the proxy configuration file on the first device according to a function called by Hook in the API library;
according to a function called by Hook in the API library, enabling the first equipment to establish connection with a proxy service port of the proxy equipment configured in the proxy configuration file; and
a sending module, configured to send a destination IP address and a port number of the second device to the proxy device, so that a proxy service port of the proxy device establishes a connection with the destination IP address and the port number of the second device;
data transmission is carried out between the API library of the Hook and the proxy service port of the proxy equipment in a mode of protocol guarantee;
wherein the connection is for the first device to transmit data to the service in the second device.
8. The Hook API-based proxy implementation of claim 7, wherein the Hook API-based proxy implementation further comprises a reading module configured to read a proxy configuration file on the first device, the proxy configuration file configuring the first device to request the service of the second device to be forwarded through a proxy service port of a proxy device.
9. A computer-readable storage medium having executable instructions stored thereon; the executable instructions, when executed by a processor, are capable of implementing the method of any one of claims 1 to 2, or the method of 3, or the method of 4.
CN201610896058.8A 2016-10-13 2016-10-13 Hook API-based proxy implementation method, data transmission method, device and system Active CN107948232B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610896058.8A CN107948232B (en) 2016-10-13 2016-10-13 Hook API-based proxy implementation method, data transmission method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610896058.8A CN107948232B (en) 2016-10-13 2016-10-13 Hook API-based proxy implementation method, data transmission method, device and system

Publications (2)

Publication Number Publication Date
CN107948232A CN107948232A (en) 2018-04-20
CN107948232B true CN107948232B (en) 2021-03-19

Family

ID=61928554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610896058.8A Active CN107948232B (en) 2016-10-13 2016-10-13 Hook API-based proxy implementation method, data transmission method, device and system

Country Status (1)

Country Link
CN (1) CN107948232B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111294399B (en) * 2020-02-04 2023-06-23 网宿科技股份有限公司 Data transmission method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968227A (en) * 2006-06-29 2007-05-23 华为技术有限公司 System and method for enabling wireless access gateway to support transparent agent
CN103916405A (en) * 2014-04-25 2014-07-09 厦门享游网络科技有限公司 Method for guiding flow of TCP/UDP of App on IOS
CN103944906A (en) * 2014-04-25 2014-07-23 厦门享游网络科技有限公司 HTTP traffic guiding method on iOS for APP
CN105450521A (en) * 2015-12-31 2016-03-30 中国电子科技集团公司电子科学研究院 Software-defined real-time dynamic optimization method of multipath network flow

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104579887A (en) * 2013-10-16 2015-04-29 宇宙互联有限公司 Cloud gateway as well as cloud gateway creation and configuration system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968227A (en) * 2006-06-29 2007-05-23 华为技术有限公司 System and method for enabling wireless access gateway to support transparent agent
CN103916405A (en) * 2014-04-25 2014-07-09 厦门享游网络科技有限公司 Method for guiding flow of TCP/UDP of App on IOS
CN103944906A (en) * 2014-04-25 2014-07-23 厦门享游网络科技有限公司 HTTP traffic guiding method on iOS for APP
CN105450521A (en) * 2015-12-31 2016-03-30 中国电子科技集团公司电子科学研究院 Software-defined real-time dynamic optimization method of multipath network flow

Also Published As

Publication number Publication date
CN107948232A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
US9507630B2 (en) Application context transfer for distributed computing resources
US20100248698A1 (en) Mobile terminal device inlcuding mobile cloud platform
EP2911063A1 (en) Remote storage system and method using network attached storage (nas) device
CN107710695B (en) Method for accessing home network additional storage equipment, corresponding device and system
CN111124299A (en) Data storage management method, device, equipment, system and storage medium
CN104378435A (en) Method for transmitting file between browser of computing device and mobile terminal
CN112312222A (en) Video sending method and device and electronic equipment
CN104394208A (en) File transmission method and server
CN114666306B (en) WebRTC network connection establishment method, server, electronic device and computer readable storage medium
CN104486371A (en) Equipment and method for downloading file on batch
Alamouti et al. Hybrid edge cloud: A pragmatic approach for decentralized cloud computing
CN104702634A (en) Method, device and system for processing data operation request
US20170171211A1 (en) Connecting and Retrieving Security Tokens Based on Context
CN114296953A (en) Multi-cloud heterogeneous system and task processing method
CN107948232B (en) Hook API-based proxy implementation method, data transmission method, device and system
CN109981778B (en) Method, device, equipment and storage medium for realizing service of content distribution network
CN111953718B (en) Page debugging method and device
CN114844744B (en) Virtual private cloud network configuration method and device, electronic equipment and computer readable storage medium
CN115623057A (en) RDMA (remote direct memory Access) -based connection establishing method, device, equipment and storage medium
US11356383B2 (en) Cloud translation mechanism
CN112383617A (en) Method, device, terminal equipment and medium for long connection
CN104484338A (en) File list management equipment and method
CN104683419A (en) Communicating method and system based on android system and m2m (machine to machine)
CN113271229B (en) Equipment control method and device, storage equipment, safety equipment, switch, router and server
CN104767667A (en) Method for sharing WEB page by multiple screens, terminal equipment and web server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant