CN112437161B - Network proxy control method, device and computer readable storage medium - Google Patents

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

Info

Publication number
CN112437161B
CN112437161B CN202011364424.8A CN202011364424A CN112437161B CN 112437161 B CN112437161 B CN 112437161B CN 202011364424 A CN202011364424 A CN 202011364424A CN 112437161 B CN112437161 B CN 112437161B
Authority
CN
China
Prior art keywords
proxy
network interface
target
client
network
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
CN202011364424.8A
Other languages
Chinese (zh)
Other versions
CN112437161A (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The present disclosure relates to the field of computer science and technology, and in particular, to a network proxy control method, device and computer readable storage medium. In the embodiment of the disclosure, responding to the operation of opening a network proxy triggered by a network proxy management area of an object in a client page display window, opening a network proxy function of a first target network interface currently used by a client, and determining a target proxy server selected by the object; the target proxy server is configured as a proxy server for data proxy forwarding of data transmitted by the first target network interface. Because the network proxy function is started through the network proxy management area in the client page display window, proxy forwarding of target network interface data is realized, and the network proxy function is started without complicated operation, so that the network proxy is more convenient and quick to operate, and the efficiency of the network proxy can be improved.

Description

Network proxy control method, device and computer readable storage medium
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a network proxy control method, a network proxy control device and a 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 web browsing speed through the proxy server, etc. At present, when a user sets a network proxy, the user needs to manually click on the setting, and then searches the setting of the network proxy through a network setting page to perform network proxy operation. The network proxy setting mode is very tedious, and the network proxy setting process is longer and the efficiency is lower.
Disclosure of Invention
The disclosure provides a network proxy control method, a network proxy control device and a computer readable storage medium, which are used for improving the efficiency of a network proxy control mode.
According to a first aspect of an embodiment of the present disclosure, there is provided a network proxy control method, including:
responding to the operation of opening a network proxy triggered by an object in a network proxy management area in a page display window of a client, opening a network proxy function of a first target network interface currently used by the client, and determining a target proxy server selected by the object;
The target proxy server is set as a proxy server for data proxy forwarding of the data transmitted by the first target network interface.
An alternative embodiment is that the determining the target proxy server of the object selection includes:
And acquiring the identification information of the proxy server input by the object through the 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.
An alternative embodiment is that the proxy server configured to perform data proxy forwarding on data transmitted by the target network interface includes:
determining hardware port information of a first target network interface currently used;
binding the hardware port information of the first target network interface with the identification information of the target proxy server.
An optional implementation manner, the determining the hardware port information of the first target network interface currently used includes:
invoking an os module to acquire a device identifier of a first target network interface currently used;
and determining hardware port information corresponding to the equipment identification of the first target network interface according to the corresponding relation between the equipment identification of each network interface supported by the client and the hardware port information, which is generated in advance.
An alternative implementation manner is that a second target network interface currently used by the client is determined in response to an operation of closing a network proxy triggered by an object in a network proxy management area in a client page display window;
And closing the network proxy function of the second target network interface.
An optional implementation manner, after the network proxy function of the second target network interface is turned off, further includes:
and releasing the target proxy server which is set for the second target network interface and used for forwarding the data transmitted by the second target network interface by the data proxy.
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 a network proxy triggered by a network proxy management area of an object in a page display window of a client, and determining a second target network interface currently used by the client;
And closing the network proxy function of the second target network interface.
An optional implementation manner, after the network proxy function of the second target network interface is turned off, further includes:
and releasing the target proxy server which is set for the second target network interface and used for forwarding the data transmitted by the second target network interface by the data proxy.
An optional implementation manner is that the releasing is a target proxy server set for the second target network interface and used for forwarding data proxy of the data transmitted by the second target network interface, and the target proxy server includes:
Determining hardware port information of a second target network interface which is currently used;
And searching and releasing the established binding relation between the hardware port information of the second target network interface and the identification information of the target proxy server.
An optional implementation manner, the determining the hardware port information of the second target network interface in use currently includes:
invoking an os module to acquire the equipment identifier of the second target network interface currently used;
And determining the hardware port information corresponding to the equipment identification of the second target network interface according to the corresponding relation between the equipment identification of each network interface supported by the client and the hardware port information, which is generated in advance.
According to a third aspect of the embodiments of the present disclosure, there is provided a network proxy control apparatus, including:
a processing unit configured to perform an operation of opening a network proxy triggered in response to a network proxy management area of an object in a page presentation window of a client, opening a network proxy function of a first target network interface currently used by the client, and determining a target proxy server selected by the object;
And the setting unit is configured to perform setting of the target proxy server as a proxy server for data proxy forwarding of the data transmitted by the first target network interface.
An alternative embodiment is that the processing unit is configured to perform:
And acquiring the identification information of the proxy server input by the object through the 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.
An alternative embodiment is that the setting unit is configured to perform:
determining hardware port information of a first target network interface currently used;
binding the hardware port information of the first target network interface with the identification information of the target proxy server.
An alternative embodiment is that the setting unit is configured to perform:
invoking an os module to acquire a device identifier of a first target network interface currently used;
and determining hardware port information corresponding to the equipment identification of the first target network interface according to the corresponding relation between the equipment identification of each network interface supported by the client and the hardware port information, which is generated in advance.
An alternative embodiment is that the setting unit is further configured to perform:
Responding to the operation of closing a network proxy triggered by a network proxy management area of an object in a page display window of a client, and determining a second target network interface currently used by the client;
And closing the network proxy function of the second target network interface.
An alternative 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 forwarding the data transmitted by the second target network interface by the data proxy.
According to a fourth aspect of embodiments of the present disclosure, there is provided another network proxy control apparatus, including:
a determining unit configured to perform an operation of closing a network proxy triggered in response to a network proxy management area of an object in a page presentation window of a client, determining a second target network interface currently used by the client;
and a closing unit configured to perform a network proxy function of closing the second target network interface.
An alternative embodiment is that 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 forwarding the data transmitted by the target network interface by the data proxy.
An optional implementation manner is that the releasing is a target proxy server set for the second target network interface and used for forwarding data proxy of the data transmitted by the second target network interface, and the target proxy server includes:
The determining unit is configured to perform:
Determining hardware port information of a second target network interface which is currently used;
the closing unit is configured to perform:
And searching and releasing the established binding relation between the hardware port information of the second target network interface and the identification information of the target proxy server.
An alternative embodiment is that the determining unit is configured to perform:
invoking an os module to acquire the equipment identifier of the second target network interface currently used;
And determining the hardware port information corresponding to the equipment identification of the second target network interface according to the corresponding relation between the equipment identification of each network interface supported by the client and the hardware port information, which is generated in advance.
According to a fifth aspect of 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 as described in 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, which when executed by a processor of a network proxy control apparatus, enables the network proxy control apparatus to perform the network proxy control method as described in the first aspect.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, which when executed by a processor of a network proxy control apparatus, enables the network proxy control apparatus to perform the network proxy control method as described in the second aspect.
According to an eighth aspect of 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 any one of the possible related methods of implementing the above aspects and aspects of embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
Because the object of the embodiment of the disclosure 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, and enabling the object to start a network proxy function through a network proxy management area in a page display window of the client. The network proxy management area in the page display window of the client opens the network proxy function, so that proxy forwarding of the first target network interface data is realized, the network proxy control mode is simple to operate, and the network proxy function is controlled without complicated operation, so that the network proxy is more convenient and quick to operate, and the efficiency of the network proxy can be improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a schematic diagram of a network proxy control system, shown in accordance with an exemplary embodiment;
FIG. 2 is a schematic diagram of a network proxy management area in a page presentation window of a browser, shown in accordance with an exemplary embodiment;
FIG. 3 is a flow chart illustrating a network proxy control method according to an example embodiment;
FIG. 4 is a schematic diagram of a network proxy management area in a page presentation window of a browser, shown in accordance with an exemplary embodiment;
FIG. 5 is a flowchart illustrating an overall network proxy control method according to an example embodiment;
FIG. 6 is a flowchart illustrating another network proxy control method according to an example embodiment;
FIG. 7 is a schematic diagram of a network proxy management area in a page presentation window of a browser, shown in accordance with an exemplary embodiment;
FIG. 8 is a general flow diagram illustrating another network proxy control method according to an example embodiment;
FIG. 9 is a block diagram of a network proxy control device, according to an example embodiment;
FIG. 10 is a block diagram of another network proxy control device shown in accordance with an exemplary embodiment;
Fig. 11 is a block diagram illustrating a network proxy control apparatus according to an exemplary embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of 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 foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
In the following, some terms in the embodiments of the present disclosure are explained for easy understanding by those skilled in the art.
(1) The term "plurality" in the embodiments of the present disclosure means two or more, and other adjectives are similar thereto.
(2) "And/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is 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, e.g., a handheld device, an in-vehicle device, etc., with a wireless connection function. Currently, some examples of terminals are: a mobile phone), a tablet, a notebook, a palm, a mobile internet device (mobile INTERNET DEVICE, MID), a wearable device, a Virtual Reality (VR) device, an augmented reality (augmented reality, AR) device, a wireless terminal in industrial control (industrial control), a wireless terminal in unmanned (SELF DRIVING), a wireless terminal in teleoperation (remote medical surgery), a wireless terminal in smart grid (SMART GRID), a wireless terminal in transportation security (transportation safety), a wireless terminal in smart city (SMART CITY), a wireless terminal in smart home (smart home), and the like.
(4) The client may refer to APP (Application) of a software class or a terminal device. The system has a visual display interface, and can interact with a user; corresponding to the server, providing local service for clients. Applications for software classes, except some applications that only run locally, are typically installed on a common client terminal, and need to run in conjunction with a server. After the development of the internet, more commonly used application programs include e-mail clients such as e-mail receiving clients and instant messaging clients. For this type of application program, there is a need to have a corresponding server and service program in the network to provide a corresponding service, such as a database service, a configuration parameter service, etc., 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, an 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 the forwarding.
(6) The server is used for serving the terminal, and the content of the service provides resources for the terminal and stores the terminal data; the server corresponds to the application program installed on the terminal and operates in cooperation with the application program on the terminal.
In the related art, when setting a network proxy and establishing connection with a proxy server, a user needs to manually operate a plurality of steps to enter a network proxy setting interface to set the network proxy, and the network proxy setting mode is complex in operation and low in efficiency.
Based on the above, fig. 1 is a schematic diagram of 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 provided with a client capable of starting a network proxy; and the client may be a browser; the following scenario describes an example of a client that may turn on a web proxy as a browser.
The object of the embodiment of the present disclosure may enter the display interface of the browser through the terminal 10, and the object may trigger the operation of opening the network proxy in the network proxy 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 supported pages of the browser; the browser responds to the network proxy starting operation triggered by the object in the network proxy management area in the page display window, starts the network proxy function of the first target network interface currently used by the browser, and determines the target proxy server selected by the object; the browser sets the target proxy server as a proxy server 20 for data proxy forwarding of the data transmitted by the first target network interface and establishes a connection with the proxy server 20.
After the connection between the browser and the proxy server 20 is established, the browser responds to the search operation triggered by the object in the browser display interface, a request is sent 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 the memory of the proxy server 20 and is the latest data, the proxy server 20 directly sends response data to the browser; on the contrary, 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.
Because the client responds to the operation of opening the network proxy triggered by the network proxy management area of the object in the page display window of the client, the network proxy function of the first target network interface currently used by the client is opened, the target proxy server selected by the object is determined, and the target proxy server is set as the proxy server for carrying out data proxy forwarding on the data transmitted by the first target network interface, the object can directly open the network proxy function through the network proxy management area in the page display window of the client. Because the object can trigger the operation of starting the network proxy directly through the network proxy management area in the client page display window, proxy forwarding of the data transmitted by the first target network interface is realized, the operation of the network proxy is more convenient and quick, and the efficiency is higher.
In the embodiment of the disclosure, a network proxy management area is set in a page display window of a client, a network proxy can be opened or closed through an object in the network proxy management area, and a proxy server to be used can be input in the network proxy management area by the object; and in the running process of the client, the proxy forwarding of the data transmitted by the client is realized through the proxy server selected by the object.
The manner in which the network agent is turned on and off, respectively, is described below.
Mode one, network proxy is turned on.
Fig. 3 is a flow chart illustrating a network proxy control method, as shown in fig. 3, according to an exemplary embodiment, comprising the steps of:
Step S301, responding to the operation of starting the network proxy triggered by the network proxy management area of the object in the page display window of the client, starting the network proxy function of the first target network interface currently used by the client, and determining the target proxy server selected by the object;
step S302, the target proxy server is set as a proxy server for data proxy forwarding of the data transmitted by the first target network interface.
The client responds to the network proxy starting operation triggered by the network proxy management area of the object in the page display window of the client, starts the network proxy function of the first target network interface currently used by the client, and sets the target proxy server selected by the object as a proxy server for carrying out data proxy forwarding on the data transmitted by the first target network interface.
In specific implementation, the object of the embodiment of the disclosure inputs the identification information of the target proxy server in the network proxy management area in the page display window of the client, and triggers the operation of opening the 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 the first target network interface currently used by the client, acquires the identification information of the proxy server input by the object through the network proxy management area in the 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 piece of identification information;
The identification information of the target proxy server may 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 disclosure, the Host may be a local address or a network address; for example, host may be a local 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 network proxy may be triggered by inputting the identification information of the proxy server in the network proxy management area in the browser page display window, for example, the identification information of the proxy server is 127.0.0.1:80, and the network proxy management area in the browser page display window; the browser responds to the operation of opening 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 network proxy management area of the object in the page display window, and takes the proxy server corresponding to 127.0.0.1:80 as a target proxy server for object selection.
After determining the target proxy server selected by the object, the client sets the target proxy server as a proxy server for performing data proxy forwarding on the data transmitted by the first target network interface.
In particular implementations, embodiments of the present disclosure may configure the target proxy server as a proxy server for data proxy forwarding of data transmitted by the first target network interface by:
1. the client determines hardware port information of the first target network interface currently in use.
In a specific implementation, the client may obtain, by invoking the os module, the device identifier of the first network interface currently used, and then determine, according to the corresponding relationship between the device identifiers of the network interfaces supported by the client and the hardware port information, the hardware port information corresponding to the device identifier of the first target network interface.
It should be noted that, the corresponding relationship between the device identifier and the hardware port information of each network interface supported by the client is generated according to the obtained device identifier and the hardware port information of each network interface supported by the client, where the operation of opening the network proxy is triggered by the client in response to the network proxy management area of the object in the 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, so as to generate the corresponding relation 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 method comprises the steps that a target network interface currently used by a client is a Wi-Fi interface, and the fact that all data of the client are transmitted through a Wi-Fi network is indicated; assuming that a target network interface currently used by the client is a USB network card, indicating that all data of the client are transmitted through the USB network card currently; the target network interface currently used by the client is assumed to be a bluetooth port, which means that all data of the client is currently transmitted through bluetooth.
In an alternative implementation, the client may execute the command line command through the child_process module, obtain the network interface supported by the client through networksetup-listallhardwareports commands, remove the useless fields, and sort the data out and output an object array 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'}]
The Hardware Port represents Hardware Port information of the network interface, and the Device represents Device identification of the network interface;
thereby acquiring the hardware port information and the equipment identification of each network port supported by the client, and generating the corresponding relation between the equipment identification and the hardware port information of each network interface supported by the client, such as
Table 1 shows the results.
Hardware port information Device identification
Wi-Fi en0
USB Ethernet en5
Bluetooth PAN en3
TABLE 1
Because 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 equipment identifiers of the network interfaces supported by the client and the hardware port information, the hardware port information of the first target network interface can be determined.
2. Binding the hardware port information of the first target network interface with the identification information of the target proxy server.
Before establishing the correspondence between the hardware port information of the first target network interface and the identification information of the target proxy server, judging whether a proxy server corresponding to the stored hardware port information of the first target network interface exists, if so, updating the proxy server corresponding to the stored hardware port information of the first target network interface to the identification information of the target proxy server, and if not, directly binding the hardware port information of the first target network interface with the identification information of the target proxy server, and storing the correspondence between the hardware port information of the first target network interface and the identification information of the target proxy server.
After binding the hardware port information of the first target network interface with the identification information of the target proxy server, the target proxy server is set as a proxy server for data proxy forwarding of 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, as shown in fig. 6, including the following steps:
Step S501, responding to the network agent management area of the object in the page display window to trigger the operation of starting the network agent, and the client acquires the identification information of the proxy 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 identifiers and the hardware port information of each network interface supported by the client according to the obtained device identifiers and the hardware port information of each network interface supported by the client;
Step S503, the client acquires the equipment identifier of the first target network interface currently used through an os module;
Step S504, the client determines hardware port information corresponding to the device identification of the first target network interface according to the generated corresponding relation between the device identification of each network interface supported by the client and the hardware port information;
Step S505, the client establishes a binding relation between the Hardware Port of the first target network interface and the identification information of the target proxy server according to the obtained identification information of the proxy server input by the object and the Hardware Port (Hardware Port information) corresponding to the first target network interface, and opens the network proxy function of the first target network interface;
In step S506, the client stores the identification information of the hard Port and the target proxy server of the first target network interface locally.
And closing the operation of the network proxy.
Fig. 6 is a flowchart illustrating a network proxy control method, as shown in fig. 7, according to an exemplary embodiment, comprising the steps of:
step S601, a second target network interface currently used by the client is determined in response to the operation of closing the network proxy triggered by the network proxy management area of the object in the page display window of the client;
step S602, the network proxy function of the second target network interface is turned off.
In the embodiment of the disclosure, the client determines a second target network interface currently used by the client in response to an operation of closing a network proxy triggered by a network proxy management area of an object in a client page display window, and closes a network proxy function of the second target network interface currently used by the client.
In a specific implementation, the operation of closing the network proxy triggered by the network proxy management area of the object in the page display window of the client is responded by the client, the hardware port information of the second target network interface which is currently used is determined by the response of the operation of closing the network proxy triggered by the network proxy management area of the object in the page display window of the client, and the network proxy function of the target network interface is closed 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 network proxy through the network proxy management area in the browser page presentation window, to close the network 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 second target network interface which is currently used, 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 particular implementations, embodiments of the present disclosure may shut down the network proxy function of the second target network interface currently in use by:
1. the client determines hardware port information of the second target network interface currently in use.
In specific implementation, the client acquires the equipment identifier of the second target network interface currently used by calling the os module; and determining hardware port information corresponding to the equipment identification of the second target network interface according to the corresponding relation between the equipment identification of each network interface supported by the client and the hardware port information.
It should be noted that, the corresponding relationship between the device identifier and the hardware port information of each network interface supported by the client is generated according to the obtained device identifier and the hardware port information of each network interface supported by the client, where the operation of opening the network proxy is triggered by the client in response to the network proxy management area of the object in the 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, so as to generate the corresponding relation 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 method comprises the steps that a target network interface currently used by a client is a Wi-Fi interface, and the fact that all data of the client are transmitted through a Wi-Fi network is indicated; assuming that a target network interface currently used by the client is a USB network card, indicating that all data of the client are transmitted through the USB network card currently; the target network interface currently used by the client is assumed to be a bluetooth port, which means that all data of the client is currently transmitted through bluetooth.
In an alternative implementation, the client may execute the command line command through the child_process module, obtain the network interface supported by the client through networksetup-listallhardwareports commands, remove the useless fields, and sort the data out and output an object array 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'}]
The Hardware Port represents Hardware Port information of the network interface, and the Device represents Device identification of the network interface;
Thus, the hardware port information and the device identification of each network port supported by the client are obtained, and the corresponding relationship between the generated device identification and the hardware port information of each network interface supported by the client is shown in table 2.
Hardware port information Device identification
Wi-Fi en0
USB Ethernet en5
Bluetooth PAN en3
TABLE 2
Because the os module is called in the embodiment of the disclosure, only the equipment identifier of the second target network interface currently used by the client can be obtained; according to the generated corresponding relation between the equipment identifiers of the network interfaces supported by the client and the hardware port information, the hardware port information of the second target network interface can be determined.
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 forwarding data transmitted by the target network interface in a data proxy mode is released.
In a specific implementation, the embodiment of the disclosure searches and releases the binding relationship between the established hardware port information of the second target network interface and the identification information of the target proxy server according to the hardware port information of the second target network interface.
Fig. 8 is an overall flowchart of another network proxy control method provided in an embodiment of the disclosure, as shown in fig. 8, including the following steps:
step S801, a client responds to the operation of closing a network proxy triggered by a network proxy management area of an object in a client page display window, and equipment identification and hardware port information of each network interface supported by the client are obtained;
step S802, the client generates a corresponding relation between the device identifiers and the hardware port information of each network interface supported by the client according to the obtained device identifiers 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 second target network interface currently used;
Step S804, the client determines the Hardware Port of the second target network interface according to the generated corresponding relation between the device identifiers of the network interfaces supported by the client and the Hardware Port information;
step S805, the client closes the network proxy function of the target network interface currently used by the client according to the Hardware Port corresponding to the obtained 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 binding relationship between the established 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 proxy control device, and because 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 the repetition is omitted.
Fig. 9 is a block diagram illustrating a network proxy control apparatus according to an exemplary 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 opening a network proxy triggered in response to a network proxy management area of an object in a page presentation window of a client, opening a network proxy function of a first target network interface currently used by the client, and determining a target proxy server for object selection;
A setting unit 92 configured to perform setting of the target proxy server as a proxy server for data proxy forwarding of the data transmitted by the first target network interface.
In an alternative embodiment, the processing unit 91 is configured to perform:
And acquiring the identification information of the proxy server input by the object through the 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 for object selection.
An alternative embodiment is that the setting unit 92 is configured to perform:
Determining hardware port information of a first target network interface currently used; binding the hardware port information of the first target network interface with the identification information of the target proxy server.
An alternative embodiment is that the setting unit 92 is configured to perform:
invoking an os module to acquire a device identifier of a first target network interface currently used; and determining hardware port information corresponding to the device identification of the first target network interface according to the corresponding relation between the device identification of each network interface supported by the client and the hardware port information.
In an alternative embodiment, the setting unit 92 is further configured to perform:
responding to the operation of closing the network proxy triggered by the network proxy management area of the object 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.
An alternative embodiment is that, after the setting unit 92 turns off the network proxy function of the second target network interface, it is further configured to perform:
And releasing the target proxy server which is set for the second target network interface and used for forwarding the data transmitted by the second target network interface by the data proxy.
The specific manner in which the respective modules perform the operations in the network proxy control apparatus in the above-described embodiment has been described in detail in the embodiment concerning the method, and will not be described in detail here.
The embodiment of the disclosure also provides a network proxy control device, and because 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 the repetition is omitted.
Fig. 10 is a block diagram illustrating another network proxy control apparatus according to an exemplary embodiment. Referring to fig. 10, the apparatus includes a determining unit 101 and a closing unit 102.
A determining unit 101, configured to determine a second target network interface currently used by the client in response to an operation of closing the network proxy triggered by the network proxy management area of the object in the page display window of the client;
and a closing unit 102 for closing the network proxy function of the second target network interface.
An alternative embodiment is that 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 forwarding the data transmitted by the second target network interface by the data proxy.
An optional implementation manner is to release a target proxy server set for the second target network interface and used for forwarding data proxy for data transmitted by the second target network interface, where the target proxy server includes:
the determination unit 101 is configured to perform: determining hardware port information of a second target network interface which is currently used;
The closing unit 102 is configured to perform: and searching and releasing the binding relation between the established hardware port information of the second target network interface and the identification information of the target proxy server.
An alternative embodiment is that the determining unit 101 is configured to perform:
invoking an os module to acquire the equipment identifier of the second target network interface currently used; and determining hardware port information corresponding to the equipment identification of the second target network interface according to the corresponding relation between the equipment identification 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, comprising:
A processor 1101 and a memory 1102 for storing instructions executable by said processor 1101;
wherein the processor 1101 is configured to execute the instructions to implement the network proxy control method as in the above embodiment.
In an exemplary embodiment, a computer storage medium is also provided, such as a memory 1102, comprising instructions executable by the processor 1101 of the live control apparatus 1100 to perform the network proxy control method described above. Alternatively, the storage medium may be a non-transitory computer readable storage medium, such as ROM, RAM, CD-ROM, magnetic tape, floppy disk, 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 perform any one of the possible network proxy control methods mentioned above in connection with implementing the 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 adaptations, 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 is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (20)

1. A network proxy control method, the method comprising:
The method comprises the steps that a display interface of a client is displayed, wherein the display interface comprises a page display window, and the page display window comprises a network agent management area; responding to the operation of opening a network proxy triggered by the object in a network proxy management area in a page display window of the client, and opening a network proxy function of a first target network interface currently used by the client; the client is an application program or terminal equipment with a display interface; the services of the application programs are provided by corresponding servers;
acquiring the identification information of the proxy server input by the object through the 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;
The target proxy server is set as a proxy server for data proxy forwarding of the data transmitted by the first target network interface.
2. The method of claim 1, wherein the configuring 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 currently used;
binding the hardware port information of the first target network interface with the identification information of the target proxy server.
3. The method of claim 2, wherein determining hardware port information of the first target network interface currently in use comprises:
invoking an os module to acquire a device identifier of a first target network interface currently used;
and determining hardware port information corresponding to the equipment identification of the first target network interface according to the corresponding relation between the equipment identification of each network interface supported by the client and the hardware port information, which is generated in advance.
4. A method according to any one of claims 1 to 3, further comprising:
Responding to the operation of closing a network proxy triggered by a network proxy management area of an object in a page display window of a client, and determining a second target network interface currently used by the client;
And closing the network proxy function of the second target network interface.
5. The method of claim 4, further comprising, after the shutting down the network proxy function of the second target network interface:
and releasing the target proxy server which is set for the second target network interface and used for forwarding the data transmitted by the second target network interface by the data proxy.
6. A network proxy control method, the method comprising:
The method comprises the steps that a display interface of a client is displayed, wherein the display interface comprises a page display window, and the page display window comprises a network agent management area; determining a second target network interface currently used by the client in response to an operation of closing a network proxy triggered by the object in a network proxy management area in a page display window of the client; the client is an application program or terminal equipment with a display interface; the services of the application programs are provided by corresponding servers;
And closing the network proxy function of the second target network interface.
7. The method of claim 6, further comprising, after the shutting down the network proxy function of the second target network interface:
and releasing the target proxy server which is set for the second target network interface and used for forwarding the data transmitted by the target network interface by the data proxy.
8. The method of claim 7, wherein the releasing the target proxy server configured for the second target network interface for data proxy forwarding of data transmitted by the second target network interface comprises:
Determining hardware port information of a second target network interface which is currently used;
And searching and releasing the established binding relation between the hardware port information of the second target network interface and the identification information of the target proxy server.
9. The method of claim 8, wherein determining hardware port information for the second target network interface currently in use comprises:
invoking an os module to acquire the equipment identifier of the second target network interface currently used;
And determining the hardware port information corresponding to the equipment identification of the second target network interface according to the corresponding relation between the equipment identification of each network interface supported by the client and the hardware port information, which is generated in advance.
10. A network proxy control apparatus, comprising:
A processing unit configured to execute a display interface of a display client, the display interface including a page presentation window, the page presentation window including a network proxy management area; responding to the operation of opening a network proxy triggered by the object in a network proxy management area in a page display window of the client, and opening a network proxy function of a first target network interface currently used by the client; the client is an application program or terminal equipment with a display interface; the services of the application programs are provided by corresponding servers; acquiring the identification information of the proxy server input by the object through the 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;
And the setting unit is configured to perform setting of the target proxy server as a proxy server for data proxy forwarding of the data transmitted by the first target network interface.
11. The apparatus of claim 10, wherein the setting unit is configured to perform:
determining hardware port information of a first target network interface currently used;
binding the hardware port information of the first target network interface with the identification information of the target proxy server.
12. The apparatus of claim 11, wherein the setting unit is configured to perform:
invoking an os module to acquire a device identifier of a first target network interface currently used;
and determining hardware port information corresponding to the equipment identification of the first target network interface according to the corresponding relation between the equipment identification of each network interface supported by the client and the hardware port information, which is generated in advance.
13. The apparatus according to any one of claims 10 to 12, wherein the setting unit is further configured to perform:
Responding to the operation of closing a network proxy triggered by a network proxy management area of an object in a page display window of a client, and determining a second target network interface currently used by the client;
And closing the network proxy function of the second target network interface.
14. The apparatus of claim 13, wherein after the setting unit turns off the network proxy function of the second target network interface, is further configured to perform:
and releasing the target proxy server which is set for the second target network interface and used for forwarding the data transmitted by the target network interface by the data proxy.
15. A network proxy control apparatus, comprising:
The determining unit is used for displaying a display interface of the client, wherein the display interface comprises a page display window, and the page display window comprises a network agent management area; determining a second target network interface currently used by the client in response to an operation of closing a network proxy triggered by the object in a network proxy management area in a page display window of the client; the client is an application program or terminal equipment with a display interface; the services of the application programs are provided by corresponding servers;
And the closing unit closes the network proxy function of the second target network interface.
16. The apparatus of claim 15, wherein 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 forwarding the data transmitted by the target network interface by the data proxy.
17. The apparatus of claim 16, wherein the releasing the target proxy server configured for the second target network interface for data proxy forwarding of data transmitted by the second target network interface comprises:
The determining unit is configured to perform:
Determining hardware port information of a second target network interface which is currently used;
the closing unit is configured to perform:
And searching and releasing the established binding relation between the hardware port information of the second target network interface and the identification information of the target proxy server.
18. The apparatus of claim 17, wherein the determining unit is configured to perform:
invoking an os module to acquire the equipment identifier of the second target network interface currently used;
And determining the hardware port information corresponding to the equipment identification of the second target network interface according to the corresponding relation between the equipment identification of each network interface supported by the client and the hardware port information, which is generated in advance.
19. 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 one of claims 1 to 5 or to implement the network proxy control method of any one of claims 6 to 9.
20. A computer readable storage medium, characterized in that instructions in the computer storage medium, when executed by a processor of a network proxy control device, enable the network proxy control device to perform the network proxy control method of any one of claims 1 to 5 or to perform the network proxy control method of any one of claims 6 to 9.
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 CN112437161A (en) 2021-03-02
CN112437161B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113691441B (en) * 2021-08-05 2023-06-20 国电南瑞科技股份有限公司 Instant messaging system, method and device for cooperation among centers of power dispatching system

Citations (5)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9602468B2 (en) * 2014-11-19 2017-03-21 Facebook, Inc. Techniques to authenticate a client to a proxy through a domain name server intermediary

Patent Citations (5)

* 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
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

Also Published As

Publication number Publication date
CN112437161A (en) 2021-03-02

Similar Documents

Publication Publication Date Title
EP3324325B1 (en) Method, client, and system for testing application
US9990214B2 (en) Dynamic agent delivery
CN108712478B (en) A kind of method and apparatus for sharing boarding application
US11379446B1 (en) Session-based data storage for chat-based communication sessions
JP2017072976A (en) Information processing system, information processing method, and program
CN111880858A (en) Document processing and instant messaging method, device, electronic equipment and storage medium
CN111090533A (en) Notice information sending method and device, electronic equipment and storage medium
JP2019175464A (en) Information processing device, information processing method and program
CN112437161B (en) Network proxy control method, device and computer readable storage medium
US9800473B2 (en) Network based virtual collaborative problem solving space
CN111766997A (en) Screenshot sharing method and device, storage medium and electronic equipment
CN104679506B (en) A kind of terminal
CN114726905A (en) Method, device, equipment and storage medium for accessing Tbox network to Android system
CN114615223A (en) Examination unmanned monitoring instant messaging method, examination unmanned monitoring instant messaging equipment, examination unmanned monitoring instant messaging system and storage medium
CN114428737A (en) Communication method, device, equipment and storage medium based on micro service system
CN111552898A (en) Flowchart drawing method and device based on Html5, computer equipment and storage medium
CN115378896B (en) Message display method and device, electronic equipment and storage medium
CN115037572B (en) Application request identification method and device
US9942361B2 (en) Reporting page composition data
CN113946386B (en) Screen capture control method and device, computer equipment and storage medium
CN115129469B (en) Cross-process communication method, device, equipment and storage medium
CN114500438B (en) File sharing method and device, electronic equipment and storage medium
CN116775670A (en) Data interaction method and device, electronic equipment and readable storage medium
CN116010744A (en) Page data processing method and device, electronic equipment and readable storage medium
CN117456993A (en) Voice control method, voice control device, electronic equipment and storage medium

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