CN112437161A - Network agent control method, device and computer readable storage medium - Google Patents

Network agent control method, device and computer readable storage medium Download PDF

Info

Publication number
CN112437161A
CN112437161A CN202011364424.8A CN202011364424A CN112437161A CN 112437161 A CN112437161 A CN 112437161A CN 202011364424 A CN202011364424 A CN 202011364424A CN 112437161 A CN112437161 A CN 112437161A
Authority
CN
China
Prior art keywords
target
network
proxy
network interface
client
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.)
Granted
Application number
CN202011364424.8A
Other languages
Chinese (zh)
Other versions
CN112437161B (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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202011364424.8A priority Critical patent/CN112437161B/en
Publication of CN112437161A publication Critical patent/CN112437161A/en
Application granted granted Critical
Publication of CN112437161B publication Critical patent/CN112437161B/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

Abstract

The present disclosure relates to the field of computer science technologies, and in particular, to a network proxy control method, device, and computer-readable storage medium. The method comprises the steps that in response to the operation of starting a network proxy triggered by an object in a network proxy management area in a client page display window, the network proxy function of a first target network interface currently used by the client is started, and a target proxy server selected by the object is determined; and setting the target proxy server as a proxy server for carrying out data proxy forwarding on the data transmitted by the first target network interface. According to the method and the device, the network agent function is started through the network agent management area in the client page display window, so that the agent forwarding of the target network interface data is realized, the network agent function is not required to be started through complicated operation, the operation of the network agent is more convenient and faster, and the efficiency of the network agent can be improved.

Description

Network agent control method, device and computer readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a network proxy control method, device, and computer-readable storage medium.
Background
With the development of computer technology, networks have moved into thousands of households, becoming an indispensable thing in modern life.
In such a background, more and more users use a proxy server as a firewall to protect a local area network, and increase a web browsing speed through the proxy server, and the like. At present, when a user sets a network proxy, the user needs to manually click on the setting, and then searches for the network proxy setting through a network setting page to perform network proxy operation. The network agent setting mode is very complicated, the network agent setting process is long, and the efficiency is low.
Disclosure of Invention
The present disclosure provides a network agent control method, device and computer readable storage medium for improving efficiency of a network agent control manner.
According to a first aspect of the embodiments of the present disclosure, there is provided a network proxy control method, including:
responding to an operation of starting a network agent triggered by an object in a network agent management area in a page display window of a client, starting a network agent function of a first target network interface currently used by the client, and determining a target agent server selected by the object;
and setting the target proxy server as a proxy server for carrying out data proxy forwarding on the data transmitted by the first target network interface.
In an optional embodiment, the determining a target proxy server selected by the object includes:
and acquiring the identification information of the proxy server input by the object through a network proxy management area in the page display window, and taking the proxy server corresponding to the input identification information of the proxy server as the target proxy server selected by the object.
An optional embodiment is that, the setting the target proxy server as a proxy server for performing data proxy forwarding on data transmitted by the target network interface includes:
determining hardware port information of a first target network interface which is currently used;
and binding the hardware port information of the first target network interface with the identification information of the target proxy server.
An optional implementation manner is that the determining hardware port information of the currently used first target network interface includes:
calling an os module to acquire the equipment identifier of the first target network interface used currently;
and determining hardware port information corresponding to the device identifier of the first target network interface according to a pre-generated corresponding relationship between the device identifier of each network interface supported by the client and the hardware port information.
An optional implementation manner is that, in response to an operation of closing a network agent triggered by an object in a network agent management area in a client page display window, a second target network interface currently used by the client is determined;
and closing the network agent function of the second target network interface.
An optional implementation manner is that, after the network proxy function of the second target network interface is turned off, the method further includes:
and releasing the target proxy server which is set for the second target network interface and used for carrying out data proxy forwarding on the data transmitted by the second target network interface.
According to a second aspect of the embodiments of the present disclosure, there is provided another network proxy control method, including:
responding to the operation of closing the network agent triggered by the object in the network agent management area in the page display window of the client, and determining a second target network interface currently used by the client;
and closing the network agent function of the second target network interface.
An optional implementation manner is that, after the network proxy function of the second target network interface is turned off, the method further includes:
and releasing the target proxy server which is set for the second target network interface and used for carrying out data proxy forwarding on the data transmitted by the second target network interface.
In an optional implementation manner, the releasing the target proxy server set for the second target network interface and used for performing data proxy forwarding on the data transmitted by the second target network interface includes:
determining the hardware port information of the currently used second target network interface;
and searching and releasing the established binding relationship between the hardware port information of the second target network interface and the identification information of the target proxy server.
An optional implementation manner is that the determining the hardware port information of the currently used second target network interface includes:
calling an os module to acquire the equipment identifier of the currently used second target network interface;
and determining hardware port information corresponding to the device identifier of the second target network interface according to a pre-generated corresponding relationship between the device identifier of each network interface supported by the client and the hardware port information.
According to a third aspect of the embodiments of the present disclosure, there is provided a network proxy control apparatus, including:
the processing unit is configured to execute an operation of starting a network proxy triggered by an object in a network proxy management area in a page display window of a client, start a network proxy function of a first target network interface currently used by the client, and determine a target proxy server selected by the object;
a setting unit configured to perform setting the target proxy server as a proxy server for performing data proxy forwarding on the data transmitted by the first target network interface.
In an optional embodiment, the processing unit is configured to perform:
and acquiring the identification information of the proxy server input by the object through a network proxy management area in the page display window, and taking the proxy server corresponding to the input identification information of the proxy server as the target proxy server selected by the object.
In an optional embodiment, the setting unit is configured to perform:
determining hardware port information of a first target network interface which is currently used;
and binding the hardware port information of the first target network interface with the identification information of the target proxy server.
In an optional embodiment, the setting unit is configured to perform:
calling an os module to acquire the equipment identifier of the first target network interface used currently;
and determining hardware port information corresponding to the device identifier of the first target network interface according to a pre-generated corresponding relationship between the device identifier of each network interface supported by the client and the hardware port information.
In an optional embodiment, the setting unit is further configured to perform:
responding to the operation of closing the network agent triggered by the object in the network agent management area in the page display window of the client, and determining a second target network interface currently used by the client;
and closing the network agent function of the second target network interface.
An optional embodiment is that, after the setting unit turns off the network proxy function of the second target network interface, the setting unit is further configured to perform:
and releasing the target proxy server which is set for the second target network interface and used for carrying out data proxy forwarding on the data transmitted by the second target network interface.
According to a fourth aspect of the embodiments of the present disclosure, there is provided another network proxy control apparatus including:
the determining unit is configured to execute an operation of closing the network agent triggered by the object in the network agent management area in the page display window of the client, and determine a second target network interface currently used by the client;
a shutdown unit configured to perform a network proxy function of shutting down the second target network interface.
In an optional embodiment, the closing unit is further configured to perform:
and releasing the target proxy server which is set for the second target network interface and used for carrying out data proxy forwarding on the data transmitted by the target network interface.
In an optional implementation manner, the releasing the target proxy server set for the second target network interface and used for performing data proxy forwarding on the data transmitted by the second target network interface includes:
the determination unit is configured to perform:
determining the hardware port information of the currently used second target network interface;
the closing unit is configured to perform:
and searching and releasing the established binding relationship between the hardware port information of the second target network interface and the identification information of the target proxy server.
In an optional embodiment, the determining unit is configured to perform:
calling an os module to acquire the equipment identifier of the currently used second target network interface;
and determining hardware port information corresponding to the device identifier of the second target network interface according to a pre-generated corresponding relationship between the device identifier of each network interface supported by the client and the hardware port information.
According to a fifth aspect of the embodiments of the present disclosure, there is provided another network proxy control apparatus, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the network proxy control method according to the first aspect or the second aspect.
According to a sixth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having instructions that, when executed by a processor of a network proxy control apparatus, enable the network proxy control apparatus to perform the network proxy control method according to the first aspect.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having instructions that, when executed by a processor of a network proxy control apparatus, enable the network proxy control apparatus to perform the network proxy control method according to the second aspect.
According to an eighth aspect of the embodiments of the present disclosure, there is provided a computer program product, which, when run on an electronic device, causes the electronic device to perform a method of implementing the above aspects of the embodiments of the present disclosure and any possible references to the aspects.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
because the object can be in the network proxy management area in the page display window of the client, the network proxy function of the first target network interface currently used by the client is started, and the target proxy server selected by the object is determined; and setting the target proxy server as a proxy server for carrying out data proxy forwarding on the data transmitted by the first target network interface, so that the object can start a network proxy function through a network proxy management area in a page display window of the client. According to the network agent control method, the network agent function is started through the network agent management area in the page display window of the client, so that the agent forwarding of the first target network interface data is realized, the operation is simple, the network agent function is not required to be controlled through complicated operation, the operation of the network agent is more convenient and faster, and the efficiency of the network agent can be improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a schematic diagram illustrating a network proxy control system in accordance with an exemplary embodiment;
FIG. 2 is a schematic diagram illustrating a network proxy management area in a page view window of a browser in accordance with an illustrative embodiment;
FIG. 3 is a flow chart illustrating a network proxy control method according to an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating a network proxy management area in a page view window of a browser in accordance with an illustrative embodiment;
FIG. 5 is an overall flow diagram illustrating a network proxy control method in accordance with an exemplary embodiment;
FIG. 6 is a flow chart illustrating another method of network proxy control according to an example embodiment;
FIG. 7 is a diagram illustrating a network proxy management area in a page view window of a browser in accordance with an illustrative embodiment;
FIG. 8 is an overall flow diagram illustrating another network proxy control method in accordance with an exemplary embodiment;
FIG. 9 is a block diagram illustrating a network proxy control device in accordance with an exemplary embodiment;
FIG. 10 is a block diagram illustrating another network proxy control device in accordance with an exemplary embodiment;
fig. 11 is a block diagram illustrating a network proxy control device according to an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Hereinafter, some terms in the embodiments of the present disclosure are explained to facilitate understanding by those skilled in the art.
(1) The term "plurality" in the embodiments of the present disclosure means two or more, and other terms are similar thereto.
(2) "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
(3) A terminal, also called a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), etc., is a device that provides voice and/or data connectivity to a user, for example, a handheld device with a wireless connection function, a vehicle-mounted device, etc. Currently, some examples of terminals are: a mobile phone (mobile phone), a tablet computer, a notebook computer, a palm top computer, a Mobile Internet Device (MID), a wearable device, a Virtual Reality (VR) device, an Augmented Reality (AR) device, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving (self driving), a wireless terminal in remote surgery (remote medical supply), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (smart security), a wireless terminal in city (smart city), a wireless terminal in home (smart home), and the like.
(4) The client may refer to an APP (Application) of a software class, or may refer to a terminal device. The system is provided with a visual display interface and can interact with a user; is corresponding to the server, and provides local service for the client. For software applications, except some applications that are only run locally, the software applications are generally installed on a common client terminal and need to be run in cooperation with a server terminal. After the internet has developed, more common applications include e-mail clients for e-mail receiving and sending, and instant messaging clients. For such applications, a corresponding server and a corresponding service program are required in the network to provide corresponding services, such as database services, configuration parameter services, and the like, so that a specific communication connection needs to be established between the client terminal and the server terminal to ensure the normal operation of the application program.
(5) The proxy server, the intermediate proxy mechanism between the personal network and the Internet service provider, is applied between the terminal and the server, and is responsible for forwarding legal network information and controlling and registering forwarding.
(6) A server serving the terminal, the contents of the service such as providing resources to the terminal, storing terminal data; the server is corresponding to the application program installed on the terminal and is matched with the application program on the terminal to run.
In the related art, when a network agent is set and a connection is established with an agent server, a user needs to manually operate a plurality of steps to enter a network agent setting interface to set the network agent, and the network agent setting mode is complex in operation and low in efficiency.
In view of the above problems, fig. 1 is a schematic diagram illustrating a network proxy control system according to an exemplary embodiment, which includes a terminal 10, a proxy server 20, and a server 30.
Wherein, the terminal 10 is installed with a client capable of starting a network agent; and the client can be a browser; the following scenario describes a client that can open a web proxy, taking a browser as an example.
The object of the present disclosure may enter the display interface of the browser through the terminal 10, and the object may trigger the operation of starting the network agent in the network agent management area in the page display window of the browser as shown in fig. 2, where the page display window of the browser may display all the supported pages of the browser; the browser responds to a network proxy starting operation triggered by an object in a network proxy management area in a page display window, starts a network proxy function of a first target network interface currently used by the browser, and determines a target proxy server selected by the object; the browser sets the target proxy server as the proxy server 20 for performing data proxy forwarding on the data transmitted by the first target network interface, and establishes connection with the proxy server 20.
After the browser is connected with the proxy server 20, the browser responds to a search operation triggered by an object in a browser display interface and sends a request to the proxy server 20, the proxy server 20 analyzes and judges the received request, and if the data requested by the browser is determined to be stored in a memory of the proxy server 20 and is the latest data, the proxy server 20 directly sends response data to the browser; otherwise, the proxy server 20 sends a request to the corresponding server 30 according to the analysis result of the received request, the server 30 sends response data to the proxy server 20 according to the request, the proxy server 20 forwards the received response data to the browser, and the browser displays the corresponding search interface according to the received response data.
In the embodiment of the present disclosure, in response to an operation of starting a network proxy triggered by an object in a network proxy management area in a page display window of a client, a client starts a network proxy function of a first target network interface currently used by the client, determines a target proxy server selected by the object, and sets the target proxy server as a proxy server for performing data proxy forwarding on data transmitted by the first target network interface, so that the object can directly start the network proxy function through the network proxy management area in the page display window of the client. The object can directly trigger the operation of starting the network agent through the network agent management area in the client page display window, so that the data transmitted by the first target network interface is subjected to agent forwarding, the operation of the network agent is more convenient and quicker, and the efficiency is higher.
The method comprises the steps that a network agent management area is arranged in a page display window of a client, a network agent can be opened or closed through an object in the network agent management area, and the object can input an agent server to be used in the network agent management area; and in the running process of the client, realizing the proxy forwarding of the data transmitted by the client through the proxy server selected by the object.
The following describes the manner of turning on the network proxy and turning off the network proxy, respectively.
The first method is to start the network proxy.
Fig. 3 is a flow chart illustrating a network proxy control method according to an exemplary embodiment, as shown in fig. 3, the method comprising the steps of:
step S301, responding to the operation of starting a network agent triggered by an object in a network agent management area in a page display window of a client, starting a network agent function of a first target network interface currently used by the client, and determining a target agent server selected by the object;
step S302, the target proxy server is set as a proxy server for performing data proxy forwarding on the data transmitted by the first target network interface.
The client responds to the network agent starting operation triggered by the object in the network agent management area in the page display window of the client, starts the network agent function of the first target network interface currently used by the client, and sets the target agent server selected by the object as the agent server for carrying out data agent forwarding on the data transmitted by the first target network interface.
In specific implementation, the object of the embodiment of the present disclosure inputs identification information of a target proxy server in a network proxy management area in a page display window of a client, and triggers an operation of starting a network proxy in the network proxy management area in the page display window of the client; the client responds to the network proxy starting operation triggered by the object, starts the network proxy function of a first target network interface currently used by the client, acquires the identification information of the proxy server input by the object through a network proxy management area in a page display window, and takes the proxy server corresponding to the input identification information of the proxy server as the target proxy server selected by the object.
It should be noted that each proxy server corresponds to one identification information;
the identification information of the target proxy server can be a port number of the target proxy server, or a port number of the target proxy server and a Host address of the target proxy server;
in the embodiment of the present disclosure, the Host may be a local address or a network address; for example, Host may be home address 127.0.0.1 and the identification information of the target proxy server may be 127.0.0.1: 80.
For example, as shown in fig. 4, after the object opens the browser, the operation of opening the web proxy may be triggered by inputting identification information of the proxy server, such as the identification information of the proxy server is 127.0.0.1:80, in the web proxy management area in the browser page display window, and in the web proxy management area in the browser page display window; the browser responds to the operation of starting the network proxy triggered by the network proxy management area of the object in the page display window, acquires the identification information 127.0.0.1:80 of the proxy server input by the object in the network proxy management area of the page display window, and takes the proxy server corresponding to 127.0.0.1:80 as the target proxy server selected by the object.
After the target proxy server selected by the object is determined, the client sets the target proxy server as a proxy server for performing data proxy forwarding on data transmitted by the first target network interface.
In a specific implementation, the target proxy server may be set as a proxy server for performing data proxy forwarding on data transmitted by the first target network interface in the following manner:
1. the client determines the hardware port information of the first target network interface currently in use.
In specific implementation, the client may obtain the device identifier of the currently used first network interface by calling the os module, and then determine the hardware port information corresponding to the device identifier of the first target network interface according to the pre-generated correspondence between the device identifier of each network interface supported by the client and the hardware port information.
It should be noted that the pre-generated correspondence between the device identifier of each network interface supported by the client and the hardware port information is generated according to the obtained device identifier of each network interface supported by the client and the hardware port information, where the client responds to an operation of starting a network agent triggered by an object in a network agent management area in a page display window.
In specific implementation, the client acquires the hardware port information and the device identifier of each network interface supported by the client, and binds the hardware port information and the device identifier of the same network interface, thereby generating a corresponding relationship between the device identifier and the hardware port information of each network interface supported by the client.
For example, the network interface supported by the client may be a Wi-Fi interface, a USB (Universal Serial BUS) network card, or a bluetooth interface.
The target network interface currently used by the client is assumed to be a Wi-Fi interface, which indicates that all current data of the client are transmitted through a Wi-Fi network; assuming that a target network interface currently used by the client is a USB network card, indicating that all current data of the client is transmitted through the USB network card; the target network interface currently used by the client is assumed to be a bluetooth port, which means that all data currently used by the client is transmitted through bluetooth.
In an alternative embodiment, the client may execute the command line command through the child _ process module, and obtain the network interface supported by the client through the network _ process-listhardware command, remove the useless field, and output an object array by arranging the data as follows:
[{'Hardware Port':'USB Ethernet',
Device:'en 5',
'Ethernet Address':'00:0e:c6:c8:e7:8e'},
{'Hardware Port':'Wi-Fi',
Device:'en0',
'Ethernet Address':'64:5a:ed:eb:01:d1'},
{'HardwarePort':'Bluetooth PAN',
Device:'en3',
'Ethernet Address':'64:5a:ed:eb:01:d 2'},
{'Hardware Port':'Thunderbolt 1',
Device:'en1',
'Ethernet Address':'6a:00:03:a7:6c:e0'},
{'Hardware Port':'Thunderbolt 2',
Device:'en2',
'Ethernet Address':'6a:00:03:a7:6c:e1'},
{'Hardware Port':'Thunderbolt Bridge',
Device:'bridge0',
'Ethernet Address':'6a:00:03:a7:6c:e0'}]
wherein, Hardware Port represents the Hardware Port information of the network interface, and Device represents the equipment identification of the network interface;
thereby obtaining the hardware port information and the device identifier of each network port supported by the client, and generating the corresponding relationship between the device identifier and the hardware port information of each network interface supported by the client, such as
Shown in table 1.
Hardware port information Device identification
Wi-Fi en0
USB Ethernet en5
Bluetooth PAN en3
TABLE 1
Since the os module is called in the embodiment of the present disclosure, only the device identifier of the first target network interface currently used by the client can be obtained; according to the generated corresponding relation between the device identification of each network interface supported by the client and the hardware port information, the hardware port information of the first target network interface can be determined.
2. And binding the hardware port information of the first target network interface with the identification information of the target proxy server.
It should be noted that, before establishing the corresponding relationship between the hardware port information of the first target network interface and the identification information of the target proxy server, it is first determined whether there is a proxy server corresponding to the stored hardware port information of the first target network interface, if so, the proxy server corresponding to the stored hardware port information of the first target network interface is updated to the identification information of the target proxy server, and if not, the hardware port information of the first target network interface is directly bound to the identification information of the target proxy server, and the corresponding relationship between the hardware port information of the first target network interface and the identification information of the target proxy server is stored.
After the hardware port information of the first target network interface is bound with the identification information of the target proxy server, the target proxy server is set as a proxy server for performing data proxy forwarding on the data transmitted by the first target network interface.
Fig. 5 is an overall flowchart of a network proxy control method according to an embodiment of the present disclosure, and as shown in fig. 6, the method includes the following steps:
step S501, responding to the operation that the object triggers and starts the network agent in the network agent management area in the page display window, and the client acquires the identification information of the agent server input by the object and acquires the equipment identification and hardware port information of each network interface supported by the client;
step S503, the client generates a corresponding relation between the device identifier and the hardware port information of each network interface supported by the client according to the obtained device identifier and the hardware port information of each network interface supported by the client;
step S503, the client acquires the device identifier of the first target network interface used currently through the os module;
step S504, the client determines the hardware port information corresponding to the device identifier of the first target network interface according to the generated corresponding relationship between the device identifier of each network interface supported by the client and the hardware port information;
step S505, the client establishes a binding relationship between the Hardware Port of the first target network interface and the identification information of the target proxy server according to the identification information of the proxy server input by the acquired object and the Hardware Port (Hardware Port information) corresponding to the first target network interface, and starts a network proxy function of the first target network interface;
step S506, the client stores the Hardware Port of the first target network interface and the identification information of the target proxy server locally.
And the second mode is to close the operation of the network agent.
Fig. 6 is a flow chart illustrating a network proxy control method according to an exemplary embodiment, as shown in fig. 7, the method comprising the steps of:
step S601, responding to the operation of closing the network agent triggered by the object in the network agent management area in the page display window of the client, and determining a second target network interface currently used by the client;
step S602, the network agent function of the second target network interface is closed.
The client side responds to the operation of closing the network proxy triggered by the object in the network proxy management area in the client side page display window, determines the second target network interface currently used by the client side, and closes the network proxy function of the second target network interface currently used by the client side.
In specific implementation, the client determines the hardware port information of the currently used second target network interface in response to the operation of closing the network agent triggered by the network agent management area of the object in the client page display window, and closes the network agent function of the target network interface according to the hardware port information of the second target network interface.
For example, as shown in fig. 7, the object may trigger an operation of closing the web proxy through a web proxy management area in a browser page presentation window, and close the web proxy function of the second target network interface currently used by the browser; and the browser responds to the operation of closing the network proxy triggered by the network proxy management area of the object in the page display window, determines the hardware port information of the currently used second target network interface, and closes the network proxy function of the second target network interface according to the hardware port information of the second target network interface.
In a specific implementation, the network proxy function of the currently used second target network interface may be turned off in the following manner:
1. the client determines the hardware port information of the second target network interface currently in use.
In specific implementation, the client acquires the equipment identifier of the currently used second target network interface by calling the os module; and determining hardware port information corresponding to the device identifier of the second target network interface according to the pre-generated corresponding relationship between the device identifier of each network interface supported by the client and the hardware port information.
It should be noted that the pre-generated correspondence between the device identifier of each network interface supported by the client and the hardware port information is generated according to the obtained device identifier of each network interface supported by the client and the hardware port information, where the client responds to an operation of starting a network agent triggered by an object in a network agent management area in a page display window.
In specific implementation, the client acquires the hardware port information and the device identifier of each network interface supported by the client, and binds the hardware port information and the device identifier of the same network interface, thereby generating a corresponding relationship between the device identifier and the hardware port information of each network interface supported by the client.
For example, the network interface supported by the client may be a Wi-Fi interface, a USB (Universal Serial BUS) network card, or a bluetooth interface.
The target network interface currently used by the client is assumed to be a Wi-Fi interface, which indicates that all current data of the client are transmitted through a Wi-Fi network; assuming that a target network interface currently used by the client is a USB network card, indicating that all current data of the client is transmitted through the USB network card; the target network interface currently used by the client is assumed to be a bluetooth port, which means that all data currently used by the client is transmitted through bluetooth.
In an alternative embodiment, the client may execute the command line command through the child _ process module, and obtain the network interface supported by the client through the network _ process-listhardware command, remove the useless field, and output an object array by arranging the data as follows:
[{'Hardware Port':'USB Ethernet',
Device:'en 5',
'Ethernet Address':'00:0e:c6:c8:e7:8e'},
{'Hardware Port':'Wi-Fi',
Device:'en0',
'Ethernet Address':'64:5a:ed:eb:01:d1'},
{'HardwarePort':'Bluetooth PAN',
Device:'en3',
'Ethernet Address':'64:5a:ed:eb:01:d 2'},
{'Hardware Port':'Thunderbolt 1',
Device:'en1',
'Ethernet Address':'6a:00:03:a7:6c:e0'},
{'Hardware Port':'Thunderbolt 2',
Device:'en2',
'Ethernet Address':'6a:00:03:a7:6c:e1'},
{'Hardware Port':'Thunderbolt Bridge',
Device:'bridge0',
'Ethernet Address':'6a:00:03:a7:6c:e0'}]
wherein, Hardware Port represents the Hardware Port information of the network interface, and Device represents the equipment identification of the network interface;
thus, the hardware port information and the device identifier of each network port supported by the client are obtained, and the generated corresponding relationship between the device identifier of each network interface supported by the client and the hardware port information is shown in table 2.
Hardware port information Device identification
Wi-Fi en0
USB Ethernet en5
Bluetooth PAN en3
TABLE 2
Since the os module is called in the embodiment of the present disclosure, only the device identifier of the second target network interface currently used by the client can be obtained; and determining the hardware port information of the second target network interface according to the generated corresponding relationship between the equipment identifier of each network interface supported by the client and the hardware port information.
2. The network proxy function of the second target network interface is turned off.
According to the determined hardware port information of the second target network interface, the network proxy function of the second target network interface is closed, and a target proxy server which is set for the second target network interface and used for carrying out data proxy forwarding on data transmitted by the target network interface is released.
In specific implementation, according to the hardware port information of the second target network interface, the embodiment of the present disclosure searches for and releases the established binding relationship between the hardware port information of the second target network interface and the identification information of the target proxy server.
Fig. 8 is an overall flowchart of another network agent control method provided in the embodiment of the present disclosure, and as shown in fig. 8, the method includes the following steps:
step S801, a client responds to the operation of closing the network agent triggered by the object in the network agent management area in the client page display window, and acquires the equipment identification and hardware port information of each network interface supported by the client;
step S802, the client generates a corresponding relation between the equipment identification and the hardware port information of each network interface supported by the client according to the obtained equipment identification and the hardware port information of each network interface supported by the client;
step S803, the client calls an os module to determine the equipment identifier of the currently used second target network interface;
step S804, the client determines a Hardware Port of a second target network interface according to the generated corresponding relationship between the equipment identifier of each network interface supported by the client and the Hardware Port information;
step S805, the client closes the network agent function of the target network interface currently used by the client according to the acquired Hardware Port corresponding to the target network interface;
step S806, after the client closes the network proxy function of the second target network interface currently used by the client, the client searches and releases the established binding relationship between the hardware port information of the second target network interface and the identification information of the target proxy server according to the determined hardware port information of the second target network interface.
The embodiment of the disclosure also provides a network agent control device, and as the principle of the device for solving the problem is similar to that of the method, the implementation of the device can refer to the implementation of the method, and repeated details are not repeated.
Fig. 9 is a block diagram illustrating a network proxy control device according to an example embodiment. Referring to fig. 9, the apparatus includes a processing unit 91 and a setting unit 92.
A processing unit 91 configured to perform an operation of starting a network proxy triggered in response to the object in a network proxy management area in a page presentation window of the client, start a network proxy function of a first target network interface currently used by the client, and determine a target proxy server selected by the object;
a setting unit 92 configured to perform setting the target proxy server as a proxy server for data proxy forwarding of data transmitted by the first target network interface.
In an optional embodiment, the processing unit 91 is configured to perform:
and acquiring identification information of the proxy server input by the object through a network proxy management area in the page display window, and taking the proxy server corresponding to the input identification information of the proxy server as a target proxy server selected by the object.
In an optional embodiment, the setting unit 92 is configured to perform:
determining hardware port information of a first target network interface which is currently used; and binding the hardware port information of the first target network interface with the identification information of the target proxy server.
In an optional embodiment, the setting unit 92 is configured to perform:
calling an os module to acquire the equipment identifier of the first target network interface used currently; and determining hardware port information corresponding to the equipment identifier of the first target network interface according to the pre-generated corresponding relationship between the equipment identifier of each network interface supported by the client and the hardware port information.
In an optional embodiment, the setting unit 92 is further configured to perform:
responding to the operation of closing the network agent triggered by the object in the network agent management area in the page display window of the client, and determining a second target network interface currently used by the client; the network proxy function of the second target network interface is turned off.
In an optional embodiment, after the setting unit 92 turns off the network proxy function of the second target network interface, the setting unit is further configured to perform:
and releasing the target proxy server which is set for the second target network interface and used for carrying out data proxy forwarding on the data transmitted by the second target network interface.
With regard to the network agent control apparatus in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.
The embodiment of the disclosure also provides a network agent control device, and as the principle of the device for solving the problem is similar to that of the method, the implementation of the device can refer to the implementation of the method, and repeated details are not repeated.
Fig. 10 is a block diagram illustrating another network proxy control device according to an example embodiment. Referring to fig. 10, the apparatus includes a determination unit 101 and a closing unit 102.
The determining unit 101 is configured to determine a second target network interface currently used by the client in response to an operation of closing the network agent triggered by the object in a network agent management area in a page display window of the client;
the closing unit 102 closes the network proxy function of the second target network interface.
In an optional embodiment, the closing unit 102 is further configured to perform:
and releasing the target proxy server which is set for the second target network interface and used for carrying out data proxy forwarding on the data transmitted by the second target network interface.
An optional implementation manner is that a target proxy server configured for a second target network interface is released for performing data proxy forwarding on data transmitted by the second target network interface, and the method includes:
the determination unit 101 is configured to perform: determining the hardware port information of the currently used second target network interface;
the closing unit 102 is configured to perform: and searching and releasing the binding relationship between the established hardware port information of the second target network interface and the identification information of the target proxy server.
In an optional embodiment, the determining unit 101 is configured to perform:
calling an os module to acquire the equipment identifier of the currently used second target network interface; and determining hardware port information corresponding to the equipment identifier of the second target network interface according to the pre-generated corresponding relationship between the equipment identifier of each network interface supported by the client and the hardware port information.
Fig. 11 is a block diagram illustrating a network proxy control apparatus 1100 according to an example embodiment, including:
a processor 1101 and a memory 1102 for storing instructions executable by the processor 1101;
wherein the processor 1101 is configured to execute the instructions to implement the network agent control method as in the above embodiments.
In an exemplary embodiment, a computer storage medium comprising instructions, such as the memory 1102 comprising instructions, executable by the processor 1101 of the live control apparatus 1100 to perform the network proxy control method described above is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which, when run on an electronic device, causes the electronic device to execute any one of the possible network proxy control methods related to the above-mentioned embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for network proxy control, the method comprising:
responding to an operation of starting a network agent triggered by an object in a network agent management area in a page display window of a client, starting a network agent function of a first target network interface currently used by the client, and determining a target agent server selected by the object;
and setting the target proxy server as a proxy server for carrying out data proxy forwarding on the data transmitted by the first target network interface.
2. The method of claim 1, wherein the determining the target proxy server for the object selection comprises:
and acquiring the identification information of the proxy server input by the object through a network proxy management area in the page display window, and taking the proxy server corresponding to the input identification information of the proxy server as the target proxy server selected by the object.
3. The method of claim 2, wherein said setting the target proxy server as a proxy server for data proxy forwarding of data transmitted by the first target network interface comprises:
determining hardware port information of a first target network interface which is currently used;
and binding the hardware port information of the first target network interface with the identification information of the target proxy server.
4. A method for network proxy control, the method comprising:
responding to the operation of closing the network agent triggered by the object in the network agent management area in the page display window of the client, and determining a second target network interface currently used by the client;
and closing the network agent function of the second target network interface.
5. The method of claim 4, wherein after the shutting down the network proxy function of the second target network interface, further comprising:
and releasing the target proxy server which is set for the second target network interface and used for carrying out data proxy forwarding on the data transmitted by the target network interface.
6. The method of claim 5, wherein the releasing the target proxy server set for the second target network interface for data proxy forwarding of data transmitted by the second target network interface comprises:
determining the hardware port information of the currently used second target network interface;
and searching and releasing the established binding relationship between the hardware port information of the second target network interface and the identification information of the target proxy server.
7. A network proxy control apparatus, comprising:
the processing unit is configured to execute an operation of starting a network proxy triggered by an object in a network proxy management area in a page display window of a client, start a network proxy function of a first target network interface currently used by the client, and determine a target proxy server selected by the object;
a setting unit configured to perform setting the target proxy server as a proxy server for performing data proxy forwarding on the data transmitted by the first target network interface.
8. A network proxy control apparatus, comprising:
the determining unit is used for determining a second target network interface currently used by the client in response to the operation of closing the network agent triggered by the object in the network agent management area in the page display window of the client;
and the closing unit is used for closing the network agent function of the second target network interface.
9. A network proxy control apparatus, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the network proxy control method of any of claims 1 to 3 or to implement the network proxy control method of any of claims 4 to 6.
10. A computer-readable storage medium, wherein instructions in the computer storage medium, when executed by a processor of a network agent control apparatus, enable the network agent control apparatus to perform the network agent control method of any of claims 1 to 3, or the network agent control method of any of claims 4 to 6.
CN202011364424.8A 2020-11-27 2020-11-27 Network proxy control method, device and computer readable storage medium Active CN112437161B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011364424.8A CN112437161B (en) 2020-11-27 2020-11-27 Network proxy control method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011364424.8A CN112437161B (en) 2020-11-27 2020-11-27 Network proxy control method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112437161A true CN112437161A (en) 2021-03-02
CN112437161B CN112437161B (en) 2024-04-30

Family

ID=74698029

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011364424.8A Active CN112437161B (en) 2020-11-27 2020-11-27 Network proxy control method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112437161B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113691441A (en) * 2021-08-05 2021-11-23 国电南瑞科技股份有限公司 Center-to-center cooperative instant communication system, method and device for power dispatching system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001142768A (en) * 1999-11-09 2001-05-25 Internatl Business Mach Corp <Ibm> Client server system, server, client, proxy server control method, proxy server function providing method and program transmitting device
CN103973682A (en) * 2014-04-30 2014-08-06 北京奇虎科技有限公司 Method and device for having access to webpage
US20160142375A1 (en) * 2014-11-19 2016-05-19 Onavo Mobile Ltd. Techniques to authenticate a client to a proxy through a domain name server intermediary
CN109525639A (en) * 2018-10-16 2019-03-26 深圳市点嘀互联网络有限公司 Vehicle electronic device connects the method that smart phone realizes online by USB line
CN109600644A (en) * 2017-09-30 2019-04-09 华为终端(东莞)有限公司 A kind of method and relevant device, computer program product of RTV remote television browser
CN111629016A (en) * 2019-02-28 2020-09-04 阿里巴巴集团控股有限公司 Control method, device and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001142768A (en) * 1999-11-09 2001-05-25 Internatl Business Mach Corp <Ibm> Client server system, server, client, proxy server control method, proxy server function providing method and program transmitting device
CN103973682A (en) * 2014-04-30 2014-08-06 北京奇虎科技有限公司 Method and device for having access to webpage
US20160142375A1 (en) * 2014-11-19 2016-05-19 Onavo Mobile Ltd. Techniques to authenticate a client to a proxy through a domain name server intermediary
CN109600644A (en) * 2017-09-30 2019-04-09 华为终端(东莞)有限公司 A kind of method and relevant device, computer program product of RTV remote television browser
CN109525639A (en) * 2018-10-16 2019-03-26 深圳市点嘀互联网络有限公司 Vehicle electronic device connects the method that smart phone realizes online by USB line
CN111629016A (en) * 2019-02-28 2020-09-04 阿里巴巴集团控股有限公司 Control method, device and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113691441A (en) * 2021-08-05 2021-11-23 国电南瑞科技股份有限公司 Center-to-center cooperative instant communication system, method and device for power dispatching system

Also Published As

Publication number Publication date
CN112437161B (en) 2024-04-30

Similar Documents

Publication Publication Date Title
JP2022017308A (en) Dynamic code management
CN110651241A (en) Connecting multiple mobile devices to a smart home assistant account
EP3324325B1 (en) Method, client, and system for testing application
CN108810123B (en) Method and apparatus for provisioning mobile cellular network services
US20180343318A1 (en) Method, device and system for associating a service account
CN110688169B (en) Application program acceleration method and device, storage medium and electronic equipment
CN112286667A (en) Application program control method and device, electronic equipment and medium
CN108039173B (en) Voice information input method, mobile terminal, system and readable storage medium
CN104899083A (en) Application share method and device
JP2017072976A (en) Information processing system, information processing method, and program
CN105389175A (en) Application program sharing method and mobile terminal
JP2019175464A (en) Information processing device, information processing method and program
WO2017121332A1 (en) Information sharing method and system
CN109032491A (en) Data processing method, device and mobile terminal
CN114726947A (en) Message display method and device, user terminal and readable storage medium
CN112437161B (en) Network proxy control method, device and computer readable storage medium
CN106789832B (en) Data processing method, device and system in call process
CN106302096B (en) Method and system for realizing geographical position display in session page
CN104679506B (en) A kind of terminal
WO2018145574A1 (en) Information processing method and device, terminal, server and storage medium
CN106775249B (en) Method for setting communication shortcut and electronic equipment
EP3499399A1 (en) Electronic apparatus and information reading control method
CN110858175A (en) Test control method, master control equipment, controlled equipment and test system
CN112260933B (en) Communication method, communication device, electronic equipment and medium
CN114428737A (en) Communication method, device, equipment and storage medium based on micro service system

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