CN105430108B - Test environment access method and proxy server - Google Patents

Test environment access method and proxy server Download PDF

Info

Publication number
CN105430108B
CN105430108B CN201410421694.6A CN201410421694A CN105430108B CN 105430108 B CN105430108 B CN 105430108B CN 201410421694 A CN201410421694 A CN 201410421694A CN 105430108 B CN105430108 B CN 105430108B
Authority
CN
China
Prior art keywords
server
proxy server
access request
test
mobile terminal
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
CN201410421694.6A
Other languages
Chinese (zh)
Other versions
CN105430108A (en
Inventor
于维军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410421694.6A priority Critical patent/CN105430108B/en
Publication of CN105430108A publication Critical patent/CN105430108A/en
Application granted granted Critical
Publication of CN105430108B publication Critical patent/CN105430108B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The test environment access method provided by the invention comprises the steps of deploying a test environment in a test server, configuring the mapping relation between the domain name of the test environment and the IP of the test server and storing the mapping relation in a shared server, receiving an access request sent by a mobile terminal and determining the domain name of the test environment to be accessed by a proxy server, acquiring the IP of the test server by the proxy server according to the mapping relation stored in a network server, forwarding the access request to the IP of the test server, the mapping relation between the domain name of the test environment and the IP of the test server is pre-configured in the shared server, a tester only needs to send an access request to a target test server through the proxy server, and does not need to configure the mapping relation between the domain name and the IP locally, so that resources are saved, the skill requirement on the tester is reduced, and the invention also provides the proxy server.

Description

Test environment access method and proxy server
Technical Field
The invention relates to the field of software testing, in particular to a test environment access method and a proxy server.
Background
In general web system development, after a business developer completes development of a new version of web system code, the web system needs to be deployed on a separate test server, so that the tester can test and verify the version quality. Since there are many sets of test environments that use the same domain name based on the same business logic, the tester needs to access different test servers through the same domain name.
In the PC era, testers can access different test servers by modifying host file contents in a windows system to realize the access of the same domain name. In the era of mobile terminals, because the currently common mobile terminal systems cannot well support host file mechanisms similar to those in windows systems, most of service developers and testers currently build a local hotspot by using a wireless network card, so that the mobile terminals are connected to the local PC through the built local hotspot, then Fiddler software (an http protocol debugging agent tool) is installed on the local PC, and the mapping relation between the required domain name and the IP of the test server is manually configured in the Fiddler software, so that the purpose that different mobile terminals access different test servers to the same domain name is achieved.
Although the current method can solve the problem that the same domain name can access different test servers, each tester needs to build a hotspot on the local PC and install the Fiddler software, and configures and maintains a mapping table from the domain name to the server IP on the Fiddler software, which wastes hardware resources and labor workload, and because the mapping relationship from the domain name of each person to the server IP is independently configured and stored on the local PC, the configured mapping relationship information cannot be shared among multiple persons, which undoubtedly increases daily modification and maintenance cost, and simultaneously reduces safety guarantee, each tester knows the configuration details of the mapping relationship, and also improves the skill requirement on the tester.
Disclosure of Invention
A first aspect of an embodiment of the present invention provides a method for accessing a test environment, where the test environment is deployed in a test server, and a first mapping relationship between a domain name of the test environment and an IP address of the test server is stored in a shared server, where the method includes:
the proxy server receives an access request sent by the mobile terminal;
the proxy server determines the domain name of the target test environment which needs to be accessed by the mobile terminal according to the access request;
the proxy server acquires the IP address of the target test server corresponding to the domain name of the target test environment according to the first mapping relation stored in the shared server;
and the proxy server forwards the access request to the target test server according to the IP address of the target test server.
With reference to the first aspect, the second aspect of the present invention further includes: before the proxy server receives the access request sent by the mobile terminal, the method comprises the following steps:
the proxy server configures a second mapping relationship between a receiving port and the test environment.
With reference to the second aspect, the third aspect of the present invention further includes: the step of determining, by the proxy server according to the access request, a domain name of a target test environment to be accessed by the mobile terminal includes:
the proxy server determines a target receiving port used for receiving the access request;
and the proxy server determines a target test environment corresponding to the target receiving port according to the second mapping relation so as to obtain a domain name of the test environment corresponding to the target test environment.
With reference to the first aspect, the fourth aspect of the present invention further includes: after the step of forwarding the access request to the target test server by the proxy server according to the IP address of the target test server, the method further includes:
and the proxy server receives a data packet fed back by the test server according to the access request and forwards the data packet to the mobile terminal.
With reference to the fourth aspect, the fifth aspect of the present invention further includes: before the step of forwarding the data packet to the mobile terminal, the method further comprises:
the proxy server configures a third mapping relation between the access request and the data packet;
and the proxy server determines the mobile terminal sending the access request according to the third mapping relation.
With reference to any one of the first to fifth aspects, the sixth aspect of the present invention further includes: before the step of the proxy server receiving the access request sent by the mobile terminal, the method further comprises the following steps:
and the proxy server and the mobile terminal establish an access request sending channel.
With reference to any one of the first to fifth aspects, the seventh aspect of the present invention further includes: the network address of the proxy server and the network address of the mobile terminal are located in the same network segment in the wireless network.
The eighth aspect of the embodiments of the present invention further provides a proxy server for test environment access, where the test environment is deployed in a test server, and the proxy server includes:
the first configuration unit is used for configuring a first mapping relation between the domain name of the test environment and the IP address of the test server and storing the first mapping relation in the shared server;
the mobile terminal comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving an access request sent by the mobile terminal;
a determining unit, configured to determine, according to the access request, a domain name of a target test environment that the mobile terminal needs to access;
an obtaining unit, configured to obtain, according to the first mapping relationship stored in the shared server, an IP address of the target test server corresponding to the domain name of the target test environment;
and the first forwarding unit is used for forwarding the access request to the target test server according to the IP address of the target test server.
With reference to the eighth aspect, the ninth aspect of the present invention further includes:
and the first configuration subunit is used for configuring a second mapping relation between the receiving port and the test environment.
With reference to the eighth aspect, the tenth aspect of the present invention further includes:
a first determining subunit, configured to determine a target receiving port used for receiving the access request;
and the second determining subunit is configured to determine, according to the second mapping relationship, a target test environment corresponding to the target receiving port, so as to obtain a domain name of the test environment corresponding to the target test environment.
With reference to the eighth aspect, the eleventh aspect of the present invention further includes:
and the second forwarding unit is used for receiving the data packet fed back by the test server according to the access request and forwarding the data packet to the mobile terminal.
With reference to the eleventh aspect, the twelfth aspect of the present invention further includes:
a second configuration unit, configured to configure, by the proxy server, a third mapping relationship between the access request and the data packet;
and the third determining subunit is used for determining the mobile terminal sending the access request according to the third mapping relation.
With reference to any one of the eighth to twelfth aspects, the thirteenth aspect of the present invention further includes:
and the channel establishing unit is used for establishing an access request sending channel between the proxy server and the mobile terminal.
With reference to any one of the eighth to twelfth aspects, the fourteenth aspect of the present invention further includes: the network address of the proxy server and the network address of the mobile terminal are located in the same network segment in the wireless network.
According to the technical scheme, the embodiment of the invention has the following advantages:
the invention provides a test environment access method, deploying a test environment in a test server, configuring a mapping relation between a domain name of the test environment and an IP of the test server and storing the mapping relation in a shared server, receiving an access request sent by a mobile terminal by a proxy server and determining the domain name of the test environment to be accessed, acquiring the IP of the test server by the proxy server according to the mapping relation stored in a network server, forwarding the access request to the IP of the test server by the proxy server, pre-configuring the mapping relation between the domain name of the test environment and the IP of the test server in the shared server, receiving the access request and acquiring the domain name of the test environment by the proxy server when in use, acquiring the IP of the corresponding test server through the mapping relation stored in the shared server, and sending the access request to a target test server by a tester only through the proxy server, the method has the advantages that the mapping relation between the domain name and the IP does not need to be configured locally by a tester, resources are saved, the skill requirement on the tester is reduced, in addition, the invention also provides the proxy server, the first mapping relation between the domain name of the test environment and the IP address of the test server does not need to be configured locally by the tester in a local computer, the resources are saved, the safety is improved, and the skill requirement on the tester is reduced.
Drawings
FIG. 1 is a diagram of an embodiment of a test environment access method according to an embodiment of the present invention;
FIG. 2 is a diagram of another embodiment of a test environment access method according to an embodiment of the present invention;
FIG. 3 is a diagram of another embodiment of a test environment access method according to an embodiment of the present invention;
FIG. 4 is a diagram of an embodiment of a proxy server in accordance with the present invention;
FIG. 5 is a diagram of another embodiment of a proxy server according to the present invention;
fig. 6 is a diagram of another embodiment of a proxy server according to the embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a test environment access method, which is used for software test, and a tester only needs to send an access request to a target test server through a proxy server and does not need to configure the mapping relation between a domain name and an IP (Internet protocol) locally, so that resources are saved, and the requirement on the skills of the tester is lowered.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Referring to fig. 1, an embodiment of a test environment access method according to the present invention includes:
101. and deploying the test environment in the test server, configuring a first mapping relation between the domain name of the test environment and the IP address of the test server, and storing the first mapping relation in the shared server.
The testing environment is usually a set of informal user testing (experiencing) environment or a general testing environment which is set up for a specific testing (experiencing) purpose, some defects and problems in a software program system can be found and experienced in advance, so as to ensure that the software system can provide good user experience for users after formal outgoing, the testing environment is arranged in a testing server, a plurality of testing environments for testing certain functions can be respectively used for realizing different testing purposes by accessing the testing server for data transmission, each testing environment is provided with a corresponding domain name, the memory is convenient, in order to access the testing server, an IP address of the testing server where the testing environment is located needs to be obtained, a first mapping relation between the domain name of the testing environment and the IP address of the testing server is configured in advance and stored in a sharing server, the sharing server is arranged in the same wireless network, the first mapping relation can be obtained from the shared server through a network access mode when the network server is used, so that a tester does not need to configure the mapping relation between the domain name of the testing environment and the IP address of the testing server on a local computer every time, the skill requirement on the tester is reduced, and resources are saved.
102. The proxy server receives an access request sent by the mobile terminal.
The mobile terminal comprises a mobile phone, a tablet and other handheld mobile devices which are commonly used at present, when a certain function is tested on the mobile terminal, an access request for accessing a required test environment needs to be initiated, and the proxy server can receive the access request.
103. And the proxy server determines the domain name of the target test environment which needs to be accessed by the mobile terminal according to the access request.
And the proxy server processes the received access request to acquire a target test environment to be accessed by the mobile terminal, and acquires a domain name corresponding to the test environment through the required test environment.
104. And the proxy server acquires the IP address of the target test server corresponding to the domain name of the target test environment according to the first mapping relation stored in the shared server.
The proxy server obtains a domain name of a target test environment required by the mobile terminal, the proxy server accesses the shared server to obtain a first mapping relation, and obtains an IP address of a corresponding target test server according to the first mapping relation and the domain name of the known test environment, namely the test server where the test environment required to be accessed by the mobile terminal is located.
105. And the proxy server forwards the access request to the target test server according to the IP address of the target test server.
The proxy server only plays a role of forwarding the access request, obtains the IP address of the target test server, and forwards the received access request to the finally required test server to finish the access.
In this embodiment, the test environment is deployed in the test server, the first mapping relationship between the domain name of the test environment and the IP address of the test server is configured and stored in the shared server, the proxy server receives the access request of the mobile terminal, the proxy server determines the domain name of the target test environment according to the access request and obtains the IP address of the test server according to the first mapping relationship stored in the shared server, and the proxy server forwards the access request to the test server to complete the access to the test environment.
For how the proxy server determines the domain name of the test environment, another embodiment of the test environment access method provided by the embodiment of the present invention includes:
201. and deploying the test environment in the test server, configuring a first mapping relation between the domain name of the test environment and the IP address of the test server, and storing the first mapping relation in the shared server.
Step 201 is similar to step 101 in the previous embodiment, and is not described herein again, but it should be noted that the first mapping relation does not need to be configured on site every time of testing, and may be configured and stored in the shared server in advance.
202. The proxy server configures a second mapping relationship between the receiving port and the test environment.
The proxy server allocates a corresponding receiving port for each testing environment, an access request of each testing environment is received through the corresponding receiving port, the proxy server configures a second mapping relation between the receiving port and a domain name of the testing environment, each receiving port corresponds to the testing environment, and the testing environment corresponds to the domain name of the testing environment with the identification.
203. The proxy server and the mobile terminal establish an access request sending channel.
The mobile terminal configures an IP address of the proxy server so that the proxy server establishes an access request transmission channel with the mobile terminal, and the IP address of the proxy server is configured to transmit the request of the mobile terminal to the proxy server.
In order to facilitate the establishment of the access request sending channel between the proxy server and the mobile terminal, in this embodiment, the network address of the proxy server and the network address of the mobile terminal are located in the same network segment in the wireless network, which facilitates the network connection between the proxy server and the mobile terminal.
It should be noted that, in this embodiment, the order of step 202 and step 203 may be reversed, that is, an access request sending channel between the proxy server and the mobile terminal may be established first, and then an access port for receiving and sending an access request may be configured.
204. The proxy server receives an access request sent by the mobile terminal.
When testing a certain function on the mobile terminal, an access request for accessing a required testing environment needs to be initiated, and the proxy server receives the access request.
205. The proxy server determines the target receiving port to use to receive the access request.
The access requests of different test environments enter the proxy server through different receiving ports, and the receiving ports used by the proxy server can be determined by the proxy server receiving the access requests.
206. And the proxy server determines a target test environment corresponding to the target receiving port according to the second mapping relation so as to obtain a domain name of the test environment corresponding to the target test environment.
The proxy server determines the used receiving port, and can obtain the testing environment corresponding to the receiving port according to the second mapping relation, in order to identify the testing environment, the testing environment corresponds to the domain name of the testing environment, and the domain name of the testing environment corresponding to the testing environment can be obtained through the testing environment, so that the IP address of the testing server can be obtained conveniently.
207. And the proxy server acquires the IP address of the target test server corresponding to the domain name of the target test environment according to the first mapping relation stored in the shared server.
The proxy server obtains a domain name of a target test environment required by the mobile terminal, the proxy server accesses the shared server to obtain a first mapping relation, and obtains an IP address of a corresponding target test server according to the first mapping relation and the domain name of the known test environment, namely the test server where the test environment required to be accessed by the mobile terminal is located.
208. And the proxy server forwards the access request to the target test server according to the IP address of the target test server.
The proxy server only plays a role of forwarding the access request, obtains the IP address of the target test server, and forwards the received access request to the finally required test server to finish the access.
In this embodiment, the proxy server configures a receiving port corresponding to a testing environment, different testing environments correspond to different receiving ports, configures a second mapping relationship between the receiving port and a domain name of the testing environment, determines a domain name of the testing environment by combining the receiving port used for receiving the access request with the second mapping relationship, identifies the domain name of the testing environment through the receiving port, does not need to analyze the content of the access request, is simple to operate, facilitates the proxy server to obtain an IP address of the testing server by combining the first mapping relationship, and forwards the access request to the testing server to complete the access to the testing environment without configuring a first mapping relationship between the domain name of the testing environment and the IP address of the testing server by a tester at a local computer, thereby saving resources, improving security, and reducing the skill requirement on the tester.
For ease of understanding, the test environment access method of the present embodiment is described below in a practical application scenario:
referring to fig. 3, another embodiment of a test environment access method according to the present invention is provided:
301. and deploying the test environment in the test server, configuring a first mapping relation between the domain name of the test environment and the IP address of the test server, and storing the first mapping relation in the shared server.
Step 301 is similar to step 201 in the previous embodiment, and details are not described here, but it should be noted that the first mapping relation does not need to be configured on site every time of testing, and may be configured and stored in the shared server in advance.
302. And the proxy server configures a second mapping relation between the receiving port and the domain name of the test environment.
The proxy server allocates a corresponding receiving port for each testing environment, the access request of each testing environment is received through the corresponding receiving port, the proxy server configures a second mapping relation between the receiving port and the domain name of the testing environment, and each receiving port corresponds to the domain name of the testing environment.
303. The proxy server and the mobile terminal establish an access request sending channel.
The mobile terminal configures an IP address of the proxy server so that the proxy server establishes an access request transmission channel with the mobile terminal, and the IP address of the proxy server is configured to transmit the request of the mobile terminal to the proxy server.
In order to facilitate the establishment of the access request sending channel between the proxy server and the mobile terminal, in this embodiment, the network address of the proxy server and the network address of the mobile terminal are located in the same network segment in the wireless network, which facilitates the network connection between the proxy server and the mobile terminal.
It should be noted that, in this embodiment, the order of step 302 and step 303 may be reversed, that is, an access request sending channel between the proxy server and the mobile terminal may be established first, and then an access port for receiving and sending an access request may be configured.
304. The proxy server receives an access request sent by the mobile terminal.
When testing a certain function on the mobile terminal, an access request for accessing a required testing environment needs to be initiated, and the proxy server receives the access request.
305. The proxy server determines the target receiving port to use to receive the access request.
The access requests of different test environments enter the proxy server through different receiving ports, and the receiving ports used by the proxy server can be determined by the proxy server receiving the access requests.
306. And the proxy server determines a target test environment corresponding to the target receiving port according to the second mapping relation so as to obtain a domain name of the test environment corresponding to the target test environment.
The proxy server determines the used receiving port, and can obtain the testing environment corresponding to the receiving port according to the second mapping relation, so as to identify the testing environment, the testing environment corresponds to the domain name of the testing environment, that is, the domain name of the testing environment corresponding to the testing environment can be obtained through the testing environment, so that the IP address of the testing server can be obtained conveniently.
In this embodiment, the proxy server configures a receiving port corresponding to a testing environment, different testing environments correspond to different receiving ports, configures a second mapping relationship between the receiving port and a domain name of the testing environment, determines a domain name of the testing environment by combining the receiving port used for receiving the access request with the second mapping relationship, identifies the domain name of the testing environment through the receiving port, does not need to analyze the content of the access request, is simple to operate, facilitates the proxy server to obtain an IP address of the testing server by combining the first mapping relationship, and forwards the access request to the testing server to complete the access to the testing environment without configuring a first mapping relationship between the domain name of the testing environment and the IP address of the testing server by a tester at a local computer, thereby saving resources, improving security, and reducing the skill requirement on the tester.
307. And the proxy server acquires the IP address of the target test server corresponding to the domain name of the target test environment according to the first mapping relation stored in the shared server.
The proxy server obtains a domain name of a target test environment required by the mobile terminal, the proxy server accesses the shared server to obtain a first mapping relation, and obtains an IP address of a corresponding target test server according to the first mapping relation and the domain name of the known test environment, namely the test server where the test environment required to be accessed by the mobile terminal is located.
308. And the proxy server forwards the access request to the target test server according to the IP address of the target test server.
The proxy server only plays a role of forwarding the access request, obtains the IP address of the target test server, and forwards the received access request to the finally required test server to finish the access.
309. The proxy server configures a third mapping relationship between the access request and the data packet.
The access request may be sent by different mobile terminals, and in order to better implement the correspondence between the access request and the fed-back data packet, the proxy server configures a third mapping relationship between the access request and the data packet, and actually, the proxy server has a corresponding relationship for recording each back packet and the request packet, and its internal logic is to forward the data packet fed back from the test server to the sender of the real access request, i.e., the mobile terminal, and those skilled in the art should understand that details are not repeated.
310. And the proxy server determines the mobile terminal sending the access request according to the third mapping relation.
And the proxy server inquires and determines the mobile terminal according to the third mapping relation, so that the fed-back data packet can be conveniently sent to the mobile terminal in the follow-up process.
311. And the proxy server receives the data packet fed back by the test server according to the access request.
The access request forwarded by the proxy server is sent to the test server, the test server completes the relevant test of the test environment according to the access request, and the proxy server receives the data packet generated by the test.
312. And the proxy server forwards the data packet to the mobile terminal.
The proxy server transmits the received data packet to the mobile terminal to complete the data exchange operation.
In this embodiment, the proxy server configures a receiving port corresponding to a testing environment, different testing environments correspond to different receiving ports, configures a second mapping relationship between the receiving port and a domain name of the testing environment, determines a domain name of the testing environment by combining the receiving port used for receiving the access request with the second mapping relationship, identifies the domain name of the testing environment through the receiving port, does not need to analyze the content of the access request, is simple to operate, facilitates the proxy server to obtain an IP address of the testing server by combining the first mapping relationship, and forwards the access request to the testing server to complete the access to the testing environment without configuring a first mapping relationship between the domain name of the testing environment and the IP address of the testing server by a tester at a local computer, thereby saving resources, improving security, and reducing the skill requirement on the tester. In addition, feedback made by the test server for the access request is further described, the proxy server forwards the access request to the test server, the test server performs corresponding test operation for the access request, a data packet generated by the test is fed back to the proxy server, the proxy server forwards the data packet fed back by the test server to the mobile terminal, the data exchange process of the whole test environment is completed, a tester does not need to configure a first mapping relation between a domain name of the test environment and an IP address of the test server in a local computer, resources are saved, safety is improved, and the requirement on the skill of the tester is lowered.
In the above description of the test environment access method in the embodiment of the present invention, referring to fig. 4, a proxy server in the embodiment of the present invention is described below, where an embodiment of the proxy server in the embodiment of the present invention includes:
a first configuration unit 401, configured to configure a first mapping relationship between a domain name of a test environment and an IP address of the test server 400, and store the first mapping relationship in the shared server 410;
the testing environment is deployed in the testing server 400, the first configuration unit 401 is configured to configure a first mapping relationship between a domain name of the testing environment and an IP address of the testing server 400 and store the first mapping relationship in the sharing server 410, the sharing server 410 may be understood as a web server, and may access the sharing server 410 through a network to obtain information on the sharing server 410, and the first configuration unit 401 configures the first mapping relationship and stores the first mapping relationship in the sharing server 410 in advance.
A receiving unit 402, configured to receive an access request sent by the mobile terminal 420.
In the testing process, the mobile terminal 420 initiates an access request according to the content to be tested, and the receiving unit 402 is configured to receive the access request sent by the mobile terminal 420.
In this embodiment, the mobile terminal 420 includes a handheld mobile device such as a mobile phone and a tablet.
A determining unit 403, configured to determine, according to the access request, a domain name of a target test environment that the mobile terminal 420 needs to access.
The determining unit 403 processes the received access request to obtain a target test environment to be accessed by the mobile terminal 420, and obtains a domain name corresponding to the test environment through the required test environment.
An obtaining unit 404, configured to obtain, according to the first mapping relationship stored in the shared server, an IP address of the target test server corresponding to the domain name of the target test environment.
The obtaining unit 404 accesses the sharing server 410 to obtain the first mapping relationship, and obtains the IP address of the corresponding target testing server 400 according to the first mapping relationship and the domain name of the known testing environment, that is, the testing server 410 where the testing environment that the mobile terminal 420 needs to access is located.
A first forwarding unit 405, configured to forward the access request to the target testing server 400 according to the IP address of the target testing server 400.
The first forwarding unit 405 only plays a role of forwarding the access request, the obtaining unit 404 obtains the IP address of the target test server 400, and the first forwarding unit 405 forwards the received access request to the finally required test server 400, thereby completing the access.
In this embodiment, the testing environment is deployed in the testing server 400, the first configuration unit 401 configures a first mapping relationship between a domain name of the testing environment and an IP address of the testing server 400 and stores the first mapping relationship in the shared server 410, the receiving unit 402 receives an access request of the mobile terminal 420, the determining unit 403 determines a domain name of a required target testing environment according to the access request, the obtaining unit 404 obtains the IP address of the testing server 400 according to the first mapping relationship stored in the shared server 410, and the first forwarding unit 401 forwards the access request to the testing server 400 to complete access to the testing environment without configuring the first mapping relationship between the domain name of the testing environment and the IP address of the testing server by a tester at a local computer, thereby saving resources, improving security, and reducing requirements on skills of the tester.
Referring to fig. 5, another embodiment of the proxy server according to the present invention includes:
a first configuration unit 501, configured to configure a first mapping relationship between a domain name of a test environment and an IP address of the test server 500, and store the first mapping relationship in the shared server 510;
a first configuration subunit 502, configured to configure a second mapping relationship between the receiving port and the domain name of the test environment.
The first configuration subunit 502 allocates a corresponding receiving port to each testing environment, an access request of each testing environment is received through the corresponding receiving port, the first configuration subunit 502 configures a second mapping relationship between the receiving port and the domain name of the testing environment, and each receiving port corresponds to the domain name of the testing environment.
A channel establishing unit 503, configured to establish an access request sending channel between the proxy server and the mobile terminal 520.
The tunnel establishment unit 503 configures an IP address of a proxy server according to the mobile terminal 520 so that the proxy server establishes an access request transmission tunnel with the mobile terminal 520, the IP address of the proxy server being configured in order to transmit a request of the mobile terminal 520 to the proxy server.
In order to facilitate the establishment of the access request sending channel between the proxy server and the mobile terminal 520, in this embodiment, the network address of the proxy server and the network address of the mobile terminal 520 are located in the same network segment in the wireless network, which facilitates the network connection between the proxy server and the mobile terminal 520, and it should be understood by those skilled in the art and will not be described again.
A receiving unit 504, configured to receive an access request sent by the mobile terminal 520.
In the testing process, the mobile terminal 520 initiates an access request according to the content to be tested, and the receiving unit is configured to receive the access request sent by the mobile terminal.
In this embodiment, the mobile terminal 520 includes a handheld mobile device such as a mobile phone and a tablet that are commonly used at present.
A first determining subunit 505, configured to determine a target receiving port used for receiving the access request;
the access requests of different test environments enter the proxy server through different receiving ports, and the receiving port used by the first determining subunit 505 can be determined by receiving the access request.
A second determining subunit 506, configured to determine, according to the second mapping relationship, a target test environment corresponding to the target receiving port, so as to obtain a domain name of the test environment corresponding to the target test environment, where, to facilitate identifying the test environment, the test environment corresponds to the domain name of the test environment.
The first determining subunit 505 determines the used receiving port, and the second determining subunit 506 may query, according to the second mapping relationship, to obtain the domain name of the test environment corresponding to the receiving port, and obtain the domain name of the test server 500, so as to obtain the IP address of the test server.
An obtaining unit 507, configured to obtain, according to the first mapping relationship stored in the shared server 510, an IP address of the target testing server 500 corresponding to the domain name of the target testing environment.
The obtaining unit 507 accesses the sharing server 510 to obtain the first mapping relationship, and obtains the IP address of the corresponding target testing server 500 according to the first mapping relationship and the domain name of the known testing environment, that is, the testing server 500 where the testing environment that the mobile terminal 520 needs to access is located.
A first forwarding unit 508, configured to forward the access request to the target testing server 500 according to the IP address of the target testing server 500.
The first forwarding unit 508 only plays a role of forwarding the access request, the obtaining unit 507 obtains the IP address of the target test server 500, and the first forwarding unit 508 forwards the received access request to the finally required test server 500, thereby completing the access.
In this embodiment, the first configuration subunit 502 configures a receiving port corresponding to a testing environment, different testing environments correspond to different receiving ports, the first configuration subunit 502 configures a second mapping relationship between the receiving port and a domain name of the testing environment, the first determining subunit 505 determines, by receiving the receiving port used by the access request, the second determining subunit 506 determines, according to the second mapping relationship, the domain name of the target testing environment corresponding to the target receiving port, identifies the domain name of the testing environment by the receiving port, without analyzing the content of the access request, the operation is simple, the obtaining unit 507 obtains the IP address of the testing server by combining the first mapping relationship, the first forwarding unit 508 forwards the access request to the testing server to complete the access to the testing environment, without configuring, by a tester, a first mapping relationship between the domain name of the testing environment and the IP address of the testing server at a local computer, the resource is saved, the safety is improved, and the skill requirement on a tester is reduced.
For convenience of understanding, please refer to fig. 6, the following describes the proxy server according to this embodiment in a practical application scenario:
a first configuration unit 601, configured to configure a first mapping relationship between a domain name of a test environment and an IP address of a test server, and store the first mapping relationship in a shared server 610;
a first configuration subunit 602, configured to configure a second mapping relationship between a receiving port and a domain name of the test environment.
The first configuration subunit 602 allocates a corresponding receiving port to each testing environment, an access request of each testing environment is received through the corresponding receiving port, the first configuration subunit 602 configures a second mapping relationship between the receiving port and a domain name of the testing environment, and each receiving port corresponds to the domain name of the testing environment.
A channel establishing unit 603, configured to establish an access request sending channel between the proxy server and the mobile terminal 620.
The tunnel establishment unit 603 configures an IP address of a proxy server according to the mobile terminal 620 so that the proxy server establishes an access request transmission tunnel with the mobile terminal 620, the IP address of the proxy server being configured in order to transmit a request of the mobile terminal 620 to the proxy server.
In order to facilitate the establishment of the access request sending channel between the proxy server and the mobile terminal 620, in this embodiment, the network address of the proxy server and the network address of the mobile terminal 620 are located in the same network segment in the wireless network, which facilitates the network connection between the proxy server and the mobile terminal 620, and it should be understood by those skilled in the art and will not be described again.
A receiving unit 604, configured to receive an access request sent by the mobile terminal 620.
In the testing process, the mobile terminal 620 initiates an access request according to the content to be tested, and the receiving unit is configured to receive the access request sent by the mobile terminal.
In this embodiment, the mobile terminal 620 includes a handheld mobile device such as a mobile phone and a tablet that are commonly used at present.
A first determining subunit 605, configured to determine a target receiving port used for receiving the access request;
the access requests of different test environments enter the proxy server through different receiving ports, and the receiving port used by the first determining subunit 605 receiving the access request can be determined.
A second determining subunit 606, configured to determine, according to the second mapping relationship, a target test environment corresponding to the target receiving port, so as to obtain a domain name of the test environment corresponding to the target test environment, where, to facilitate identifying the test environment, the test environment corresponds to the domain name of the test environment.
The first determining subunit 605 determines the used receiving port, and the second determining subunit 606 may query the domain name of the test environment corresponding to the receiving port according to the second mapping relationship, so as to obtain the domain name of the test environment, which is convenient for obtaining the IP address of the test server 600.
An obtaining unit 607, configured to obtain, according to the first mapping relationship stored in the shared server 610, an IP address of the target testing server 600 corresponding to the domain name of the target testing environment.
The obtaining unit 607 accesses the sharing server 610 to obtain the first mapping relationship, and obtains the IP address of the corresponding target testing server 600 according to the first mapping relationship and the domain name of the known testing environment, that is, the testing server 600 where the testing environment that the mobile terminal 620 needs to access is located.
A first forwarding unit 608, configured to forward the access request to the target testing server 600 according to the IP address of the target testing server 600.
The first forwarding unit 608 only plays a role of forwarding the access request, the obtaining unit obtains the IP address of the target test server, and the first forwarding unit forwards the received access request to the finally required test server to complete the access.
A second configuring unit 609, configured to configure, by the proxy server, a third mapping relationship between the access request and the data packet.
The access request may be sent by different mobile terminals, and in order to better implement that the access request corresponds to the fed-back data packet, the second configuration unit 609 configures a third mapping relationship between the access request and the data packet, and may forward the data packet fed back from the test server 600 to the sender of the real access request, i.e., the mobile terminal 620, which should be understood by those skilled in the art and will not be described again
A third determining subunit 611, configured to determine, according to the third mapping relationship, a mobile terminal that sends the access request.
The third determining subunit 611 determines the mobile terminal according to the third mapping relationship, so as to subsequently send the fed-back data packet to the mobile terminal.
A second receiving unit 612, configured to receive a data packet fed back by the test server according to the access request.
The test server 600 completes the relevant test of the test environment according to the access request, and the second receiving unit 612 receives the data packet generated by the test, because the access request is first forwarded from the proxy server and sent to the target test server, the data packet fed back by the test server will be automatically returned to the proxy server, which is based on the basic principle of the Soeket (socket) communication bottom layer, and it should be understood by those skilled in the art, and will not be described again.
A second forwarding unit 613, configured to forward the data packet to the mobile terminal 620.
The second forwarding unit 613 forwards the received data packet to the mobile terminal 620, thereby completing the data exchange operation.
In this embodiment, the first configuration subunit 602 configures a receiving port corresponding to a testing environment, different testing environments correspond to different receiving ports, the first configuration subunit 602 configures a second mapping relationship between the receiving port and a domain name of the testing environment, the first determining subunit 605 determines, by receiving the receiving port used by the access request, the second determining subunit 606 determines, according to the second mapping relationship, the domain name of the target testing environment corresponding to the target receiving port, identifies the domain name of the testing environment by the receiving port, without analyzing the content of the access request, the operation is simple, the obtaining unit 607 is convenient to obtain the IP address of the testing server in combination with the first mapping relationship, the first forwarding unit 608 forwards the access request to the testing server to complete the access to the testing environment, without configuring, by a tester, a first mapping relationship between the domain name of the testing environment and the IP address of the testing server in a local computer, the resource is saved, the safety is improved, and the skill requirement on a tester is reduced. In addition, it is further described that the test server makes feedback for the access request, the first forwarding unit 608 forwards the access request to the test server 600, the test server 600 performs corresponding test operation for the access request, and feeds back a data packet generated by the test to the second receiving unit 612, the second configuring unit 609 configures a third mapping relationship between the access request and the data packet, the third determining subunit 611 determines the mobile terminal 620 that sends the access request according to the third mapping relationship, and the second forwarding unit 613 forwards the data packet to the mobile terminal 620, thereby completing the data exchange process of the whole test environment.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A test environment access method is characterized in that a test environment is deployed in a test server, a first mapping relation between a domain name of the test environment and an IP address of the test server is stored in a shared server, and the method comprises the following steps:
the proxy server configures a second mapping relation between a receiving port and the test environment;
the proxy server receives an access request sent by the mobile terminal;
the proxy server determines a target receiving port used for receiving the access request;
the proxy server determines a target test environment corresponding to the target receiving port according to the second mapping relation so as to obtain a domain name of the test environment corresponding to the target test environment;
the proxy server acquires the IP address of the target test server corresponding to the domain name of the target test environment according to the first mapping relation stored in the shared server;
and the proxy server forwards the access request to the target test server according to the IP address of the target test server.
2. The test environment access method of claim 1, wherein after the step of the proxy server forwarding the access request to the target test server according to the IP address of the target test server, the method further comprises:
and the proxy server receives a data packet fed back by the target test server according to the access request and forwards the data packet to the mobile terminal.
3. The test environment access method of claim 2, wherein the step of forwarding the data packet to the mobile terminal further comprises, prior to the step of forwarding the data packet to the mobile terminal:
the proxy server configures a third mapping relation between the access request and the data packet;
and the proxy server determines the mobile terminal sending the access request according to the third mapping relation.
4. The test environment access method according to any one of claims 1 to 3, wherein the step of the proxy server receiving the access request sent by the mobile terminal further comprises:
and the proxy server and the mobile terminal establish an access request sending channel.
5. The test environment access method according to any one of claims 1 to 3, wherein the network address of the proxy server and the network address of the mobile terminal are located in the same network segment in a wireless network.
6. A proxy server for test environment access, the test environment being deployed at a test server, the proxy server comprising:
the first configuration unit is used for configuring a first mapping relation between the domain name of the test environment and the IP address of the test server and storing the first mapping relation in the shared server;
the first configuration subunit is used for configuring a second mapping relation between a receiving port and the test environment;
the mobile terminal comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving an access request sent by the mobile terminal;
a first determining subunit, configured to determine a target receiving port used for receiving the access request;
a second determining subunit, configured to determine, according to the second mapping relationship, a target test environment corresponding to the target receiving port, so as to obtain a domain name of the test environment corresponding to the target test environment;
an obtaining unit, configured to obtain, according to the first mapping relationship stored in the shared server, an IP address of the target test server corresponding to the domain name of the target test environment;
and the first forwarding unit is used for forwarding the access request to the target test server according to the IP address of the target test server.
7. The proxy server of claim 6, further comprising:
and the second forwarding unit is used for receiving the data packet fed back by the target test server according to the access request and forwarding the data packet to the mobile terminal.
8. The proxy server of claim 7, further comprising:
a second configuration unit, configured to configure, by the proxy server, a third mapping relationship between the access request and the data packet;
and the third determining subunit is used for determining the mobile terminal sending the access request according to the third mapping relation.
9. The proxy server according to any of claims 6 to 8, characterized in that the proxy server further comprises:
and the channel establishing unit is used for establishing an access request sending channel between the proxy server and the mobile terminal.
10. The proxy server according to any of claims 6 to 8, wherein the network address of the proxy server is located in the same network segment in the wireless network as the network address of the mobile terminal.
CN201410421694.6A 2014-08-25 2014-08-25 Test environment access method and proxy server Active CN105430108B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410421694.6A CN105430108B (en) 2014-08-25 2014-08-25 Test environment access method and proxy server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410421694.6A CN105430108B (en) 2014-08-25 2014-08-25 Test environment access method and proxy server

Publications (2)

Publication Number Publication Date
CN105430108A CN105430108A (en) 2016-03-23
CN105430108B true CN105430108B (en) 2020-03-03

Family

ID=55508044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410421694.6A Active CN105430108B (en) 2014-08-25 2014-08-25 Test environment access method and proxy server

Country Status (1)

Country Link
CN (1) CN105430108B (en)

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402880B (en) * 2016-05-20 2020-10-16 腾讯科技(北京)有限公司 Test method and electronic equipment
CN107566203A (en) * 2016-07-01 2018-01-09 北京京东尚科信息技术有限公司 A kind of online service method of testing and system
CN106506281B (en) * 2016-11-24 2019-12-03 深圳市金溢科技股份有限公司 Vehicle toll communication test method, the network equipment and system
CN108574604B (en) * 2017-03-07 2020-09-29 北京京东尚科信息技术有限公司 Test method and device
CN107154976A (en) * 2017-05-10 2017-09-12 北京微影时代科技有限公司 Website testing method, device and system
CN107634851B (en) * 2017-08-11 2021-03-30 珠海金山网络游戏科技有限公司 Method for dynamically configuring server by mobile terminal
CN107566211B (en) * 2017-08-23 2020-10-09 北京小米移动软件有限公司 Method, device and system for accessing test equipment
CN107580080B (en) * 2017-09-15 2021-03-12 北京奇艺世纪科技有限公司 Test environment connection method and device
CN107959601A (en) * 2018-01-04 2018-04-24 深圳市富途网络科技有限公司 A kind of method and system for being switched fast network test environment
CN110278120A (en) * 2018-03-13 2019-09-24 中国移动通信集团广东有限公司 A kind of test environment with suitable method and proxy server
CN108959086B (en) * 2018-06-29 2023-02-03 北京金山数字娱乐科技有限公司 Program package testing deployment method, device, system, electronic equipment and storage medium
CN111953718A (en) * 2019-05-15 2020-11-17 北京京东尚科信息技术有限公司 Page debugging method and device
CN111131436B (en) * 2019-12-20 2022-08-30 广州品唯软件有限公司 Method and device for quickly searching proxy and readable storage medium
CN111625222B (en) * 2020-05-26 2023-08-04 北京互金新融科技有限公司 Online verification system and method for front-end codes
CN113965543B (en) * 2020-07-03 2024-01-16 深圳市腾讯网域计算机网络有限公司 Access method, device and storage medium of application server
CN113783713A (en) * 2020-08-04 2021-12-10 北京沃东天骏信息技术有限公司 Method, device and system for configuring proxy
CN112532473B (en) * 2020-11-12 2023-09-01 苏宁金融科技(南京)有限公司 DNS-based multi-environment test access method and device
CN113051159A (en) * 2021-03-18 2021-06-29 中国工商银行股份有限公司 Mobile terminal application testing method and device
CN113114794A (en) * 2021-03-26 2021-07-13 上海万物新生环保科技集团有限公司 Method and device for processing domain name based on secondary proxy
CN113608994A (en) * 2021-06-30 2021-11-05 天津五八到家货运服务有限公司 Request processing method and system
CN113507527B (en) * 2021-07-20 2023-05-30 上海万物新生环保科技集团有限公司 Code data access method and device based on gateway forwarding
CN114070883B (en) * 2021-11-12 2023-03-24 腾讯科技(深圳)有限公司 Test resource access method and device, electronic equipment and storage medium
CN114285779A (en) * 2021-12-21 2022-04-05 度小满科技(北京)有限公司 Method, device and system for processing test request

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8037415B1 (en) * 2007-09-21 2011-10-11 United Services Automobile Association (Usaa) Systems, methods, and computer readable media for managing a hosts file
CN103067417A (en) * 2011-10-19 2013-04-24 华耀(中国)科技有限公司 Web service mapping method and system of security agent in virtual private network (VPN)
CN103581213A (en) * 2012-07-19 2014-02-12 阿里巴巴集团控股有限公司 Shared Hosts file application method, equipment and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090172393A1 (en) * 2007-12-31 2009-07-02 Haluk Kent Tanik Method And System For Transferring Data And Instructions Through A Host File System

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8037415B1 (en) * 2007-09-21 2011-10-11 United Services Automobile Association (Usaa) Systems, methods, and computer readable media for managing a hosts file
CN103067417A (en) * 2011-10-19 2013-04-24 华耀(中国)科技有限公司 Web service mapping method and system of security agent in virtual private network (VPN)
CN103581213A (en) * 2012-07-19 2014-02-12 阿里巴巴集团控股有限公司 Shared Hosts file application method, equipment and system

Also Published As

Publication number Publication date
CN105430108A (en) 2016-03-23

Similar Documents

Publication Publication Date Title
CN105430108B (en) Test environment access method and proxy server
CN105391811B (en) domain name resolution method, access method of application server and terminal thereof
CN110034984B (en) Access method, device and system
CN105376107B (en) Terminal testing method and proxy server
WO2017024842A1 (en) Internet access authentication method, client, computer storage medium
CN110248364B (en) IOT equipment network distribution method, device, equipment and medium
CN108139936B (en) Method, apparatus and system for providing access to a serial port of a virtual machine in a self-deployed virtual application
US20180124150A1 (en) Remote access of cellular communication devices for software development and testing
CN104579887A (en) Cloud gateway as well as cloud gateway creation and configuration system and method
JP6766393B2 (en) Communication controllers, methods and programs for DHCP
CN106357609A (en) User creation method and system, public network server and private cloud equipment
CN107710695B (en) Method for accessing home network additional storage equipment, corresponding device and system
CN104270204A (en) Testing method and testing equipment for wireless communication module
CN103109517A (en) Double-stack terminal accessing service method, terminal and system
CN103516851B (en) A kind of wireless product cloud test platform system
CN103945364A (en) Data transmission method, first terminal and system
CN103516567A (en) Method and system for equipment discovery and server
CN105827463B (en) A kind of configuration method of client traffic, apparatus and system
CN103716400A (en) Method and system for achieving mobile working based on virtual machine
CN110278092A (en) Router long-range control method and system based on MQTT agreement
CN102891900B (en) A kind of method, apparatus and system of the domain name mapping in flow unloading
CN113900939A (en) Test environment access method and device, readable storage medium and computer equipment
JP2015537262A (en) System and method for sharing image data
CN110278558B (en) Message interaction method and WLAN system
US20140136597A1 (en) Relay enabled dynamic virtual private network

Legal Events

Date Code Title Description
C06 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