CN108418852B - Access control method, proxy server, and storage medium - Google Patents
Access control method, proxy server, and storage medium Download PDFInfo
- Publication number
- CN108418852B CN108418852B CN201810036385.5A CN201810036385A CN108418852B CN 108418852 B CN108418852 B CN 108418852B CN 201810036385 A CN201810036385 A CN 201810036385A CN 108418852 B CN108418852 B CN 108418852B
- Authority
- CN
- China
- Prior art keywords
- url
- service function
- proxy server
- request
- server
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention provides an access control method, a proxy server and a storage medium. The method comprises the following steps: a first proxy server receives a request of a first service function and a request of a second service function, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a first URL, and a URL used by the request of the second service function is a second URL; the first proxy server proxies the first URL into a third URL, and sends the request of the first service function to a second proxy server according to the third URL, so that the second proxy server proxies the third URL into the first URL and then sends the request of the first service function to the first server according to the first URL; and the first proxy server sends the request of the second service function to a second server according to the second URL. The invention reduces the probability of errors.
Description
Technical Field
The present invention relates to the field of software testing, and in particular, to an access control method, a proxy server, and a storage medium.
Background
Before software is released to the market, it is often necessary to test the software.
In the prior art, during the test, the server 1 may process the request of the service function 1, and the server 2 may process the request of the service function 2. Since two servers usually use the same domain name, in order to ensure that the request of the service function 1 can be sent to the server 1, and the request of the service function 2 can be sent to the server 2, generally, the following two ways can be adopted: mode 1) when the service function 2 needs to be executed, the proxy function of the proxy server is closed, so that the request of the service function 2 is directly directed to the server 2, and when the service function 1 needs to be executed, the proxy function of the proxy server is opened, so that the request of the service function 1 is directed to the server 1 through the proxy server; mode 2 the proxy server does not point to the server 1 and the server 2 through the domain name, but through an IP + port number, at this time, the user needs to obtain the IP addresses and the port numbers of the server 1 and the server 2, and sets the proxy server according to the obtained IP addresses and the port numbers.
However, the above two methods in the prior art have the problems of complicated operation and easy error.
Disclosure of Invention
The invention provides an access control method, a proxy server and a storage medium, which are used for solving the problems of complex operation and easy error in the prior art.
In a first aspect, the present invention provides an access control method, including:
a first proxy server receives a request of a first service function and a request of a second service function, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a first URL, a URL used by the request of the second service function is a second URL, and the first URL and the second URL correspond to the same domain name;
the first proxy server proxies the first URL into a third URL, and sends the request of the first service function to a second proxy server according to the third URL, so that the second proxy server proxies the third URL into the first URL and then sends the request of the first service function to the first server according to the first URL, wherein the third URL and the first URL correspond to different domain names;
the first proxy server sends the request of the second service function to a second server according to the second URL;
and the domain names used by the first server and the second server are the same as the domain name corresponding to the first URL.
In one possible implementation design, before the first proxy server receives the request of the first service function and the request of the second service function, the method further includes:
and the first proxy server determines to proxy the first URL as the third URL according to the configuration input of a user.
In one possible implementation design, after the first proxy server sends the request of the first service function to the second proxy server according to the third URL, the method further includes:
the first proxy server receives the response of the first service function sent by the second proxy server; the URL used by the first service function in response is the third URL;
and the first proxy server proxies the third URL as the first URL and sends a response of the first service function according to the first URL.
In a second aspect, the present invention provides an access control method, including:
a second proxy server receives a request of a first service function sent by a first proxy server, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a third URL;
the second proxy server proxies the third URL into a first URL, and the third URL and the first URL correspond to different domain names;
and the second proxy server sends the request of the first service function to the first server according to the first URL.
In one possible implementation design, before the second proxy server receives the request of the first service function sent by the first proxy server, the method further includes:
and the second proxy server determines to proxy the third URL as the first URL according to the configuration input of the user.
In one possible implementation design, after the second proxy server sends the request of the first service function to the first server according to the first URL, the method further includes:
the second proxy server receives a response of the first service function sent by the first server, wherein the URL used by the response of the first service function is the first URL;
the second proxy server proxies the first URL to be the third URL, and sends the response of the first service function to the first proxy server according to the third URL, so that the first proxy server proxies the third URL to be the first URL, and sends the response of the first service function according to the first URL.
In a third aspect, the present invention provides a proxy server, where the proxy server is a first proxy server, and the proxy server includes:
a first request receiving module, configured to receive a request of a first service function and a request of a second service function, where a Uniform Resource Locator (URL) used by the request of the first service function is a first URL, a URL used by the request of the second service function is a second URL, and the first URL and the second URL correspond to a same domain name;
the proxy sending module is used for proxying the first URL as a third URL and sending the request of the first service function to a second proxy server according to the third URL so that the second proxy server proxies the third URL as the first URL and then sends the request of the first service function to the first server according to the first URL, wherein the third URL and the first URL correspond to different domain names;
the first request sending module is used for sending the request of the second service function to a second server according to the second URL;
and the domain names used by the first server and the second server are the same as the domain name corresponding to the first URL.
In one design of possible implementation, the proxy server further includes: and the first configuration module is used for determining to proxy the first URL into the third URL according to the configuration input of the user.
In one possible implementation design, the proxy server further includes: a first response receiving module, configured to receive a response of the first service function sent by the second proxy server; the URL used by the first service function in response is the third URL;
the proxy sending module is further configured to proxy the third URL as the first URL, and send a response to the first service function according to the first URL.
In a fourth aspect, the present invention provides a proxy server, wherein the proxy server is a second proxy server, and the proxy server includes:
the second request receiving module is used for receiving a request of a first service function sent by a first proxy server, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a third URL;
the proxy module is used for proxy the third URL to be a first URL, and the third URL and the first URL correspond to different domain names;
and the second request sending module is used for sending the request of the first service function to the first server by the second proxy server according to the first URL.
In one possible implementation design, the proxy server further includes: and the second configuration module is used for determining to proxy the third URL as the first URL according to the configuration input of the user.
In one design of possible implementation, the proxy server further includes:
a second response receiving module, configured to receive a response of the first service function sent by the first server, where a URL used by the response of the first service function is the first URL;
and the response proxy sending module is used for proxying the first URL as the third URL and sending the response of the first service function to the first proxy server according to the third URL so that the first proxy server proxies the third URL as the first URL and sends the response of the first service function according to the first URL.
In a fifth aspect, the present invention provides a proxy server, where the proxy server is a first proxy server, and the proxy server includes:
a processor and a memory for storing computer instructions; the processor executes the computer instructions to perform the method of any of the first aspects described above.
In a sixth aspect, the present invention provides a proxy server, wherein the proxy server is a second proxy server, and the proxy server includes:
a processor and a memory for storing computer instructions; the processor executes the computer instructions to perform the method of any of the second aspects described above.
In a seventh aspect, the present invention provides a storage medium having stored thereon computer instructions which, when executed by a processor, implement the method of any of the first aspect above.
In an eighth aspect, the present invention provides a storage medium having stored thereon computer instructions which, when executed by a processor, implement the method of any of the second aspects described above.
The access control method, the proxy server and the storage medium provided by the invention proxy the first URL as a third URL through the first proxy server, and sends the request of the first service function to a second proxy server according to the third URL, so that after the second proxy server proxies the third URL as the first URL, sending the request of the first service function to a first server according to the first URL, sending the request of the second service function to a second server by the first proxy server according to the second URL, so that when the first server and the second server both use the same domain name, sending a request for a first service function to the first server is enabled, and the request for the second service function is sent to the second server, and the user does not need to do complex operation, thereby reducing the error probability.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic diagram of an application scenario of the access control method of the present invention
FIG. 2 is a flowchart of a first embodiment of an access control method according to the present invention;
FIG. 3 is a flowchart of a second embodiment of an access control method of the present invention;
FIG. 4 is a flowchart of a third embodiment of an access control method of the present invention;
FIG. 5A is a first schematic interface diagram of Charles in accordance with the present invention;
FIG. 5B is a second schematic interface diagram of Charles in accordance with the present invention;
FIG. 5C is a diagram illustrating a third embodiment of an access control method according to the present invention;
FIG. 6 is a diagram illustrating a configuration of a proxy server according to a first embodiment of the present invention;
FIG. 7 is a diagram illustrating a second exemplary embodiment of a proxy server;
FIG. 8 is a schematic structural diagram of a third embodiment of a proxy server according to the present invention;
fig. 9 is a schematic structural diagram of a fourth embodiment of the proxy server according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic view of an application scenario of the access control method of the present invention. As shown in fig. 1, the application scenario may include: the terminal comprises a terminal, a first proxy server, a second proxy server, a first server and a second server, wherein the first proxy server is in communication connection with the terminal, the second proxy server and the second server, and the second proxy server is in communication connection with the first server. Wherein the first server and the second server may use the same domain name.
Optionally, the first server may be a test server or a sandbox server, and the second server may be an online server; alternatively, the first server may be an online server and the second server may be a test server or a sandbox server.
Optionally, as shown in fig. 1, the application scenario may further include a third proxy server; and the third proxy server is respectively in communication connection with the first proxy server and the second server.
It should be noted that, the first proxy server and the second proxy server may be implemented by the same computer or computer group, or the first proxy server and the second proxy server may be implemented by different computers or computer groups, which is not limited in this disclosure.
Fig. 2 is a flowchart of a first embodiment of the access control method of the present invention, and an execution subject of the method of the present embodiment may be the first proxy server. As shown in fig. 2, the method of this embodiment may include:
In this step, there may be a one-to-one correspondence between the request of the service function and the URL, and the request of the service function may use the URL corresponding to the request of the service function to distinguish the requests of the service function. For example, the URL corresponding to the first service function request may be app.58.com/aa, and the URL corresponding to the second service function request may be app.58. com/bb. Optionally, the first service function may be a service function to be tested, and the second service function may be another service function that is relied on when the service function to be tested is tested; or, the second service function may be a service function to be tested, and the first service function may be another service function that is relied on when the service function to be tested is tested.
The first proxy server may receive the request of the first service function and then receive the request of the second service function, or receive the request of the second service function and then receive the request of the first service function, or receive the request of the first service function and the request of the second service function at the same time, which is not limited in the present invention. The request of the first service function and the request of the second service function may be sent to the first proxy server by the same device, or may also be sent to the first proxy server by different devices, which is not limited in the present invention.
In this step, the third URL and the first URL correspond to different domain names, and the third URL and the second URL correspond to different domain names because the first URL and the second URL correspond to the same domain name. The first URL used by the request of the first service function is referred to as a third URL, which may be understood as modifying the URL used by the request of the first service function from the first URL to the third URL. After the first proxy server proxies the first URL as a third URL, a domain name of a URL requested to be used by the first service function (i.e., the third URL) is different from a domain name of a URL requested to be used by the second service function (i.e., the second URL), so that the first proxy server may send the request of the first service function to the second proxy server and send the request of the second service function to the non-second proxy server according to the domain name of the URL requested to be used by the service function. Optionally, when the first service function is a tested service function, the first server may be a test server or a sandbox server; when the first service function is another service function that is relied on when the tested service function is tested, the first server may be an online server.
It should be noted that the domain name used by the first server and the domain name corresponding to the first URL may be the same. The first server may be understood as a server that handles requests of the first service function.
In this step, since the first proxy server and the second server have a communication connection, the request of the second service function may be sent to the second server according to a second URL. Specifically, the first proxy server may directly send the request of the second service function to the second server according to the second URL, or the first proxy server may send the request of the second service function to the third proxy server according to the second URL, and the third proxy server sends the request of the second service function to the second server according to the second URL. Optionally, when the second service function is a tested service function, the second server may be an online server; when the second service function is another service function that is relied on when the tested service function is tested, the second server may be a test server or a sandbox server.
It should be noted that the domain name used by the second server may be the same as the domain name corresponding to the first URL. The second server may be understood as a server that handles requests of the second service function.
In this embodiment, the first URL is proxied to be a third URL by the first proxy server, and the request of the first service function is sent to the second proxy server according to the third URL, so that after the third URL is proxied to be the first URL by the second proxy server, the request of the first service function is sent to the first server according to the first URL, and the request of the second service function is sent to the second server by the first proxy server according to the second URL, so that when the first server and the second server both use the same domain name, the request of the first service function can be sent to the first server, and the request of the second service function can be sent to the second server without a user performing a complicated operation, thereby reducing the probability of errors.
Fig. 3 is a flowchart of a second embodiment of the access control method of the present invention, and an execution subject of the method of this embodiment may be the second proxy server. As shown in fig. 3, the method of this embodiment may include:
In this step, since the first proxy server proxies the first URL as a third URL in step 202 and sends the request of the first service function to the second proxy server according to the third URL, the URL used by the request of the first service function received by the second proxy server is the third URL.
In this step, the third URL is referred to as the first URL, which may be understood as the URL used by the request of the first service function being modified from the third URL back to the first URL.
In this step, since the second proxy server has a communication connection with the first server, the request of the first service function may be sent to the first server according to the first URL.
It should be noted that, this embodiment mainly describes related implementation of the opposite side of the embodiment shown in fig. 2, and corresponding contents thereof may refer to the embodiment shown in fig. 2, which is not described herein again.
In this embodiment, the second proxy server proxies the URL used by the request of the first service function to the first URL from the third URL, and sends the request of the first service function to the first server according to the first URL, so that the URL used by the request of the first service function is recovered, and the request of the first service function can be sent to the first server that processes the request of the first service function.
Fig. 4 is a flowchart of a third embodiment of an access control method according to the present invention, and this embodiment mainly describes an interaction process between a first proxy server and a second proxy server based on the embodiments shown in fig. 2 and fig. 3. As shown in fig. 4, the method of this embodiment may include:
In this step, the first proxy server may be specifically Charles or fiddler. For Charles, assuming that the first URL is app.58.com/bb and the third URL is myapp.58.com/bb, the user may proxy app.58.com/bb to myapp.58.com/bb by entering the configuration shown in fig. 5A in the interface shown in fig. 5A. Before displaying the interface shown in fig. 5A, a home page of Charles may be displayed, and when the user selects a remote map button, the interface shown in fig. 5A is displayed. For fiddler, assuming the first URL is app.58.com/bb and the third URL is myapp.58.com/bb, proxying app.58.com/bb as myapp.58.com/bb may be accomplished by adding software code to javascriptedor. Specifically, "app.58. com/bb" may be used as a source (orgin) and "myapp.58. com/bb" may be used as a destination (dest) in the software code, and may be implemented by using a Replace method, Replace (orgin, dest), for the URL of the first business function.
It should be noted that what is actually displayed in the interface of fig. 5A may also be english, specifically, the english corresponding To "Edit Mapping" in fig. 5A is "Edit Mapping", "originating" corresponding english is "Map From", "Mapping" corresponding english is "Map To", "Protocol" corresponding english is "Protocol", "Host" corresponding english is "Host", "Port" corresponding english is "Port", "Path" corresponding english is "Path", "Query" corresponding english is "Query", "Cancel" corresponding english is "Cancel", and "OK" corresponding To "confirm".
In addition, the first proxy server determines to point the domain name corresponding to the second URL to the third proxy server and to point the domain name corresponding to the third URL to the second proxy server according to the configuration input of the user. Specifically, when the first proxy server is Charles, assuming that the domain name corresponding to the second URL is app.58.com, and the domain name corresponding to the third URL is myapp.58.com, the first proxy server may implement directing app.58.com to the third proxy server and directing myapp.58.com to the second proxy server according to the configuration shown in fig. 5B input by the user on the interface shown in fig. 5B, where IP1 is an IP address of the third proxy server, and IP2 is an IP address of the second proxy server. Before displaying the interface shown in fig. 5B, Charles' home page may be displayed, and when the user selects a Domain Name System (DNS) Spoofing (DNS Spoofing) button, the interface shown in fig. 5B is displayed. When the first proxy server is fiddler, assuming that the domain name corresponding to the second URL is app.58.com, and the domain name corresponding to the third URL is myapp.58.com, the application.58.com is directed to the third proxy server and the myapp.58.com is directed to the second proxy server by adding software codes into javasscripdor.
It should be noted that what is actually displayed in the interface of fig. 5B may also be english, specifically, the english corresponding to "DNS Spoofing Settings" in fig. 5B is "DNS Spoofing Settings", "Enable DNS Spoofing" is "Enable DNS Spoofing", "Host Name" is "Address" is "Add" is "Remove" is "Cancel", and "OK" is "confirm" is corresponding to english.
In this step, the second proxy server may specifically be a local Nginx. Assuming that the first URL is app.58.com/bb and the third URL is myapp.58.com/bb, the user may add a service (server) in the configuration file nginx.conf of Nginx, listen to the 80 port, start Nginx, and implement proxying the third URL as the first URL. Wherein, the server _ name in the server can be myapp.58.com, and the location (location) can be proxy _ pass https:// app.58.com $ request _ uri.
It should be noted that there is no restriction on the order between step 401 and step 402.
In this step, the request of the first service function and the request of the second service function may be specifically sent to the first proxy server by a terminal, and the terminal may be specifically a mobile phone, a computer, or the like. Taking the first URL as app.58.com/bb, the second URL as app.58.com/aa, and the first proxy server as Charles or fiddler as an example, as shown in fig. 5C, the terminal sends a request for the first service function (i.e., request 1) and a request for the second service function (i.e., request 2) to Charles or fiddler.
In this step, taking the third URL as myapp.58.com/bb, the second proxy server as local Nginx, the third proxy server as sandbox Nginx, the second service function as the tested service function, and the second server as a test server or sandbox server, as shown in fig. 5C, Charles or fiddler proxies app.58.com/bb as myapp.58.com/bb, sends request 1 to local Nginx according to myapp.58.com/bb, and sends request 2 to the test server or sandbox server according to app.58. com/aa.
In this step, taking the first service function as another service function depended on when testing the tested service function, and taking the first server as an online server as an example, as shown in fig. 5C, the local Nginx proxies myapp.58.com/bb as app.58.com/bb, and sends the request 1 to the online server according to app.58.com/bb.
In this step, the response of the first service function corresponds to the request of the first service function.
It should be noted that step 406 and step 407 can be understood as the reverse process of step 404 and step 405, and are not described herein again.
And step 408, the first proxy server proxies the third URL as the first URL, and sends a response to the first service function according to the first URL.
In this step, when the request of the first service function is sent from the terminal to the first proxy server, the first proxy server sends the response of the first service function to the terminal.
In this embodiment, the first URL is proxied to a third URL by the first proxy server, and sending a request for the first service function to a second proxy server according to the third URL, the second proxy server proxying the third URL as the first URL, and sends the request of the first service function to a first server according to the first URL, the first proxy server sends the request of the second service function to a second server according to the second URL, when the testing server and the online server use the same domain name, the method can realize that the request of the tested service function is sent to one server, and the request of other service functions depended on when the tested service function is tested is sent to another server, and a user does not need to do complex operation, so that the error probability is reduced.
Fig. 6 is a schematic structural diagram of a first embodiment of a proxy server according to the present invention, and the proxy server provided in this embodiment may be applied to the method embodiments shown in fig. 1 and fig. 3 to implement the function of the first proxy server. As shown in fig. 6, the proxy server of this embodiment may include: a first request receiving module 601, a proxy sending module 602, and a first request sending module 603.
The first request receiving module 601 is configured to receive a request of a first service function and a request of a second service function, where a uniform resource locator URL used by the request of the first service function is a first URL, a URL used by the request of the second service function is a second URL, and the first URL and the second URL correspond to the same domain name;
a proxy sending module 602, configured to proxy the first URL as a third URL, and send the request of the first service function to a second proxy server according to the third URL, so that after the second proxy server proxies the third URL as the first URL, the request of the first service function is sent to the first server according to the first URL, where the third URL and the first URL correspond to different domain names;
a first request sending module 603, configured to send the request of the second service function to a second server according to the second URL;
and the domain names used by the first server and the second server are the same as the domain name corresponding to the first URL.
Optionally, the first service function is a tested service function, the second service function is another service function relied for testing the tested service function, the first server is a test server or a sandbox server, and the second server is an online server; or, the second service function is a tested service function, the first service function is another service function depending on when the tested service function is tested, the first server is an online server, and the second server is a test server or a sandbox server.
Optionally, the proxy server of this embodiment further includes: a first configuration module 604, configured to determine to proxy the first URL as the third URL according to a configuration input of a user.
Optionally, the proxy server of this embodiment further includes: a first response receiving module 605, configured to receive a response of the first service function sent by the second proxy server; the URL used by the first service function in response is the third URL;
the proxy sending module 602 is further configured to proxy the third URL as the first URL, and send a response to the first service function according to the first URL.
The proxy server of this embodiment may be used to implement the technical solutions of the first proxy server in the method embodiment shown in fig. 1 and the method embodiment shown in fig. 3, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 7 is a schematic structural diagram of a second embodiment of the proxy server according to the present invention, and the proxy server provided in this embodiment may be applied to the method embodiments shown in fig. 2 and fig. 3 to implement the function of the second proxy server. As shown in fig. 7, the proxy server of this embodiment may include: a second request receiving module 701, an agent module 702, and a second request sending module 703.
The second request receiving module 701 is configured to receive a request of a first service function sent by a first proxy server, where a uniform resource locator URL used in the request of the first service function is a third URL;
a proxy module 702, configured to proxy the third URL as a first URL, where the third URL and the first URL correspond to different domain names;
a second request sending module 703, configured to send, by the second proxy server according to the first URL, the request of the first service function to the first server.
Optionally, the first service function is a tested service function, the second service function is another service function relied for testing the tested service function, the first server is a test server or a sandbox server, and the second server is an online server; or, the second service function is a tested service function, the first service function is another service function depending on when the tested service function is tested, the first server is an online server, and the second server is a test server or a sandbox server.
Optionally, the proxy server of this embodiment further includes: a second configuration module 704, configured to determine to proxy the third URL as the first URL according to a configuration input of a user.
Optionally, the proxy server of this embodiment further includes:
a second response receiving module 705, configured to receive a response of the first service function sent by the first server, where a URL used by the response of the first service function is the first URL;
a response proxy sending module 706, configured to proxy the first URL as the third URL, and send the response of the first service function to the first proxy server according to the third URL, so that the first proxy server proxies the third URL as the first URL, and sends the response of the first service function according to the first URL.
The proxy server of this embodiment may be used to implement the technical solutions of the method embodiment shown in fig. 2 and the second proxy server of the method embodiment shown in fig. 3, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 8 is a schematic structural diagram of a third embodiment of a proxy server according to the present invention, where the proxy server is a first proxy server. As shown in fig. 8, the proxy server may include: a first processor 801 and a first memory 802 for storing computer instructions.
Wherein the first processor 801 executes the computer instructions to perform the following method:
a first proxy server receives a request of a first service function and a request of a second service function, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a first URL, a URL used by the request of the second service function is a second URL, and the first URL and the second URL correspond to the same domain name;
the first proxy server proxies the first URL into a third URL, and sends the request of the first service function to a second proxy server according to the third URL, so that the second proxy server proxies the third URL into the first URL and then sends the request of the first service function to the first server according to the first URL, wherein the third URL and the first URL correspond to different domain names;
the first proxy server sends the request of the second service function to a second server according to the second URL;
and the domain names used by the first server and the second server are the same as the domain name corresponding to the first URL.
Optionally, the first service function is a tested service function, the second service function is another service function relied for testing the tested service function, the first server is a test server or a sandbox server, and the second server is an online server; or, the second service function is a tested service function, the first service function is another service function depending on when the tested service function is tested, the first server is an online server, and the second server is a test server or a sandbox server.
Optionally, before the first proxy server receives the request of the first service function and the request of the second service function, the method further includes:
and the first proxy server determines to proxy the first URL as the third URL according to the configuration input of a user.
Optionally, after the first proxy server sends the request of the first service function to the second proxy server according to the third URL, the method further includes:
the first proxy server receives the response of the first service function sent by the second proxy server; the URL used by the first service function in response is the third URL;
and the first proxy server proxies the third URL as the first URL and sends a response of the first service function according to the first URL.
Fig. 9 is a schematic structural diagram of a fourth embodiment of the proxy server according to the present invention, where the proxy server is a second proxy server. As shown in fig. 9, the proxy server may include: a second processor 901 and a second memory 902 for storing computer instructions.
Wherein the second processor 901 executes the computer instructions to execute the following method:
a second proxy server receives a request of a first service function sent by a first proxy server, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a third URL;
the second proxy server proxies the third URL into a first URL, and the third URL and the first URL correspond to different domain names;
and the second proxy server sends the request of the first service function to the first server according to the first URL.
Optionally, the first service function is a tested service function, the second service function is another service function relied for testing the tested service function, the first server is a test server or a sandbox server, and the second server is an online server; or, the second service function is a tested service function, the first service function is another service function depending on when the tested service function is tested, the first server is an online server, and the second server is a test server or a sandbox server.
Optionally, before the second proxy server receives the request of the first service function sent by the first proxy server, the method further includes:
and the second proxy server determines to proxy the third URL as the first URL according to the configuration input of the user.
Optionally, after the second proxy server sends the request of the first service function to the first server according to the first URL, the method further includes:
the second proxy server receives a response of the first service function sent by the first server, wherein the URL used by the response of the first service function is the first URL;
the second proxy server proxies the first URL to be the third URL, and sends the response of the first service function to the first proxy server according to the third URL, so that the first proxy server proxies the third URL to be the first URL, and sends the response of the first service function according to the first URL.
The present invention also provides a storage medium having instructions that, when executed by a first processor of a first proxy server, enable the first proxy server to perform an access control method, the method comprising:
a first proxy server receives a request of a first service function and a request of a second service function, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a first URL, a URL used by the request of the second service function is a second URL, and the first URL and the second URL correspond to the same domain name;
the first proxy server proxies the first URL into a third URL, and sends the request of the first service function to a second proxy server according to the third URL, so that the second proxy server proxies the third URL into the first URL and then sends the request of the first service function to the first server according to the first URL, wherein the third URL and the first URL correspond to different domain names;
the first proxy server sends the request of the second service function to a second server according to the second URL;
and the domain names used by the first server and the second server are the same as the domain name corresponding to the first URL.
Optionally, the first service function is a tested service function, the second service function is another service function relied for testing the tested service function, the first server is a test server or a sandbox server, and the second server is an online server; or, the second service function is a tested service function, the first service function is another service function depending on when the tested service function is tested, the first server is an online server, and the second server is a test server or a sandbox server.
Optionally, before the first proxy server receives the request of the first service function and the request of the second service function, the method further includes:
and the first proxy server determines to proxy the first URL as the third URL according to the configuration input of a user.
Optionally, after the first proxy server sends the request of the first service function to the second proxy server according to the third URL, the method further includes:
the first proxy server receives the response of the first service function sent by the second proxy server; the URL used by the first service function in response is the third URL;
and the first proxy server proxies the third URL as the first URL and sends a response of the first service function according to the first URL.
The present invention also provides a storage medium having instructions that, when executed by a second processor of a second proxy server, enable the second proxy server to perform an access control method, the method comprising:
a second proxy server receives a request of a first service function sent by a first proxy server, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a third URL;
the second proxy server proxies the third URL into a first URL, and the third URL and the first URL correspond to different domain names;
and the second proxy server sends the request of the first service function to the first server according to the first URL.
Optionally, the first service function is a tested service function, the second service function is another service function relied for testing the tested service function, the first server is a test server or a sandbox server, and the second server is an online server; or, the second service function is a tested service function, the first service function is another service function depending on when the tested service function is tested, the first server is an online server, and the second server is a test server or a sandbox server.
Optionally, before the second proxy server receives the request of the first service function sent by the first proxy server, the method further includes:
and the second proxy server determines to proxy the third URL as the first URL according to the configuration input of the user.
Optionally, after the second proxy server sends the request of the first service function to the first server according to the first URL, the method further includes:
the second proxy server receives a response of the first service function sent by the first server, wherein the URL used by the response of the first service function is the first URL;
the second proxy server proxies the first URL to be the third URL, and sends the response of the first service function to the first proxy server according to the third URL, so that the first proxy server proxies the third URL to be the first URL, and sends the response of the first service function according to the first URL.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (16)
1. An access control method, comprising:
a first proxy server receives a request of a first service function and a request of a second service function, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a first URL, a URL used by the request of the second service function is a second URL, and the first URL and the second URL correspond to the same domain name;
the first proxy server proxies the first URL into a third URL, and sends the request of the first service function to a second proxy server according to the third URL, so that the second proxy server proxies the third URL into the first URL and then sends the request of the first service function to the first server according to the first URL, wherein the third URL and the first URL correspond to different domain names;
the first proxy server sends the request of the second service function to a second server according to the second URL;
and the domain names used by the first server and the second server are the same as the domain name corresponding to the first URL.
2. The method of claim 1, wherein before the first proxy server receives the request for the first service function and the request for the second service function, further comprising:
and the first proxy server determines to proxy the first URL as the third URL according to the configuration input of a user.
3. The method of claim 1, wherein after the first proxy server sends the request for the first service function to the second proxy server according to the third URL, the method further comprises:
the first proxy server receives the response of the first service function sent by the second proxy server; the URL used by the first service function in response is the third URL;
and the first proxy server proxies the third URL as the first URL and sends a response of the first service function according to the first URL.
4. An access control method, comprising:
a second proxy server receives a request of a first service function sent by a first proxy server, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a third URL;
the second proxy server proxies the third URL into a first URL, and the third URL and the first URL correspond to different domain names;
and the second proxy server sends the request of the first service function to the first server according to the first URL.
5. The method of claim 4, wherein before the second proxy server receives the request for the first service function sent by the first proxy server, the method further comprises:
and the second proxy server determines to proxy the third URL as the first URL according to the configuration input of the user.
6. The method of claim 4, wherein after sending the request for the first service function to the first server according to the first URL, the second proxy server further comprises:
the second proxy server receives a response of the first service function sent by the first server, wherein the URL used by the response of the first service function is the first URL;
the second proxy server proxies the first URL to be the third URL, and sends the response of the first service function to the first proxy server according to the third URL, so that the first proxy server proxies the third URL to be the first URL, and sends the response of the first service function according to the first URL.
7. A proxy server, wherein the proxy server is a first proxy server, the proxy server comprising:
a first request receiving module, configured to receive a request of a first service function and a request of a second service function, where a Uniform Resource Locator (URL) used by the request of the first service function is a first URL, a URL used by the request of the second service function is a second URL, and the first URL and the second URL correspond to a same domain name;
the proxy sending module is used for proxying the first URL as a third URL and sending the request of the first service function to a second proxy server according to the third URL so that the second proxy server proxies the third URL as the first URL and then sends the request of the first service function to the first server according to the first URL, wherein the third URL and the first URL correspond to different domain names;
the first request sending module is used for sending the request of the second service function to a second server according to the second URL;
and the domain names used by the first server and the second server are the same as the domain name corresponding to the first URL.
8. The proxy server of claim 7, further comprising: and the first configuration module is used for determining to proxy the first URL into the third URL according to the configuration input of the user.
9. The proxy server of claim 7, further comprising: a first response receiving module, configured to receive a response of the first service function sent by the second proxy server; the URL used by the first service function in response is the third URL;
the proxy sending module is further configured to proxy the third URL as the first URL, and send a response to the first service function according to the first URL.
10. A proxy server, wherein the proxy server is a second proxy server, the proxy server comprising:
the second request receiving module is used for receiving a request of a first service function sent by a first proxy server, wherein a Uniform Resource Locator (URL) used by the request of the first service function is a third URL;
the proxy module is used for proxy the third URL to be a first URL, and the third URL and the first URL correspond to different domain names;
and the second request sending module is used for sending the request of the first service function to the first server by the second proxy server according to the first URL.
11. The proxy server of claim 10, further comprising: and the second configuration module is used for determining to proxy the third URL as the first URL according to the configuration input of the user.
12. The proxy server of claim 10, further comprising:
a second response receiving module, configured to receive a response of the first service function sent by the first server, where a URL used by the response of the first service function is the first URL;
and the response proxy sending module is used for proxying the first URL as the third URL and sending the response of the first service function to the first proxy server according to the third URL so that the first proxy server proxies the third URL as the first URL and sends the response of the first service function according to the first URL.
13. A proxy server, wherein the proxy server is a first proxy server, the proxy server comprising:
a processor and a memory for storing computer instructions; the processor executes the computer instructions to perform the method of any of claims 1-3.
14. A proxy server, wherein the proxy server is a second proxy server, the proxy server comprising:
a processor and a memory for storing computer instructions; the processor executes the computer instructions to perform the method of any of claims 4-6.
15. A storage medium having stored thereon computer instructions, wherein the computer instructions, when executed by a processor, implement the method of any of claims 1-3.
16. A storage medium having stored thereon computer instructions, wherein the computer instructions, when executed by a processor, implement the method of any of claims 4-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810036385.5A CN108418852B (en) | 2018-01-15 | 2018-01-15 | Access control method, proxy server, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810036385.5A CN108418852B (en) | 2018-01-15 | 2018-01-15 | Access control method, proxy server, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108418852A CN108418852A (en) | 2018-08-17 |
CN108418852B true CN108418852B (en) | 2021-02-19 |
Family
ID=63125629
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810036385.5A Active CN108418852B (en) | 2018-01-15 | 2018-01-15 | Access control method, proxy server, and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108418852B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2001082023A2 (en) * | 2000-04-20 | 2001-11-01 | Versedge Technologies Ltd. | Differentiated content and application delivery via internet |
CN103309877A (en) * | 2012-03-12 | 2013-09-18 | 腾讯科技(深圳)有限公司 | Method and device for cross-domain communication and full-duplex communication |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030163567A1 (en) * | 2002-02-28 | 2003-08-28 | Mcmorris Patrick | Domain name validation using mapping table |
CN103220372B (en) * | 2012-01-19 | 2016-08-10 | 中国移动通信集团公司 | Data service access method and system |
CN102970384B (en) * | 2012-11-13 | 2016-06-01 | 北京奇虎科技有限公司 | Proxy server and communication system |
-
2018
- 2018-01-15 CN CN201810036385.5A patent/CN108418852B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2001082023A2 (en) * | 2000-04-20 | 2001-11-01 | Versedge Technologies Ltd. | Differentiated content and application delivery via internet |
CN103309877A (en) * | 2012-03-12 | 2013-09-18 | 腾讯科技(深圳)有限公司 | Method and device for cross-domain communication and full-duplex communication |
Also Published As
Publication number | Publication date |
---|---|
CN108418852A (en) | 2018-08-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11095711B2 (en) | DNS Resolution of internal tenant-specific domain addresses in a multi-tenant computing environment | |
CN110351283B (en) | Data transmission method, device, equipment and storage medium | |
CN107770138B (en) | Method for specifying IP address, proxy server and client | |
JP6968261B2 (en) | Computer-implemented methods, information transmission methods, data transmission computing devices, information transmission servers, non-transient, computer-readable media and computer-implemented systems. | |
US9565161B2 (en) | Automatically replacing localhost as hostname in URL with fully qualified domain name or IP address | |
CN109729040B (en) | Method, apparatus and computer readable medium for selection of a protocol | |
US20130198266A1 (en) | Facilitating communication between web-enabled devices | |
CN107613037B (en) | Domain name redirection method and system | |
CN106657180B (en) | Information transmission method and device for cloud service, terminal equipment and system | |
CN107124483A (en) | Domain name analytic method and server | |
CN104852919A (en) | Method and apparatus for realizing portal authentication | |
CN106357814B (en) | A kind of document handling method, agency service end and client | |
CN104639555B (en) | request processing method, system and device | |
CN103581351A (en) | Method and device for having access to network | |
CN106254328B (en) | A kind of access control method and device | |
CN109218389A (en) | The method, apparatus and storage medium and electronic equipment of processing business request | |
US10284606B2 (en) | Setting up communication between a web application and a terminal | |
US10158587B2 (en) | Communication between a web application instance connected to a connection server and a calling entity other than said connection server | |
CN114338597A (en) | Network access method and device | |
US11134117B1 (en) | Network request intercepting framework for compliance monitoring | |
CN107517248B (en) | Network connection method and device based on SDK | |
CN107534585B (en) | Communication method and terminal | |
US11245717B1 (en) | Automated detection, alarming, and removal of subdomain takeovers | |
CN105991791A (en) | Message forwarding method and device | |
CN108418852B (en) | Access control method, proxy server, 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 | ||
GR01 | Patent grant |