CN110113440B - Request response method, device and terminal - Google Patents
Request response method, device and terminal Download PDFInfo
- Publication number
- CN110113440B CN110113440B CN201910300213.9A CN201910300213A CN110113440B CN 110113440 B CN110113440 B CN 110113440B CN 201910300213 A CN201910300213 A CN 201910300213A CN 110113440 B CN110113440 B CN 110113440B
- Authority
- CN
- China
- Prior art keywords
- http
- request
- address
- dns
- 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
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/10—Mapping addresses of different types
- H04L61/103—Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- 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/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the invention provides a request response method, which is applied to an HTTP client and comprises the following steps: sending a DNS resolution request to a preset DNS server based on a preset protocol, so that the preset DNS server resolves a domain name carried in the DNS resolution request into a target IP address, and sends the target IP address to the HTTP client, wherein the preset protocol is a protocol different from a standard DNS resolution protocol; sending an HTTP request to an HTTP server with an IP address as a target IP address, so that the HTTP server responds to the HTTP request to obtain a response result, and feeding the response result back to the HTTP client; and receiving a response result fed back by the HTTP server. Therefore, the technical scheme provided by the embodiment of the invention can improve the probability of obtaining the accurate IP address and the probability of obtaining the accurate response result by the HTTP client.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a request response method, an apparatus, and a terminal.
Background
HTTP (HyperText Transfer Protocol) is an application layer Protocol based on TCP/IP (Transfer Control Protocol/Internet Protocol), which is a typical request/response Protocol.
Specifically, the HTTP client sends an analysis request carrying a domain name to a standard domain name system DNS server, and the standard DNS server analyzes the domain name into an IP address after receiving the request; sending the analyzed IP address to an HTTP client; and after receiving the HTTP request sent by the HTTP client, the HTTP server responds to the HTTP request to obtain a response result, and feeds the response result back to the HTTP client.
However, the inventor finds that the prior art has at least the following problems in the process of implementing the invention:
the existing HTTP client sends a resolution request carrying a domain name to a standard DNS server based on a standard DNS resolution protocol. However, in practical applications, the standard DNS resolution protocol has a high probability of being hijacked, and once the standard DNS resolution protocol is hijacked, the HTTP client cannot obtain an accurate IP address, and finally the HTTP client cannot obtain an accurate response result.
Disclosure of Invention
The embodiment of the invention aims to provide a request response method, a request response device and electronic equipment, so as to improve the probability of obtaining an accurate IP address and the probability of obtaining an accurate response result by an HTTP client. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a request response method, which is applied to an HTTP client, and the method includes:
sending a DNS resolution request to a preset DNS server based on a preset protocol, so that the preset DNS server resolves a domain name carried in the DNS resolution request into a target IP address, and sends the target IP address to the HTTP client, wherein the preset protocol is a protocol different from a standard DNS resolution protocol;
sending an HTTP request to an HTTP server with an IP address as a target IP address, so that the HTTP server responds to the HTTP request to obtain a response result, and feeding the response result back to the HTTP client;
and receiving a response result fed back by the HTTP server.
Optionally, the step of sending a DNS resolution request to a preset DNS server based on a preset protocol includes:
and when the DNS server with the judgment standard fails to resolve the domain name into the IP address, sending a DNS resolution request to a preset DNS server based on a preset protocol.
Optionally, the preset protocol is HTTP, and the preset server is an HTTP DNS server;
the step of sending a DNS resolution request to a preset DNS server based on a preset protocol includes:
and sending a DNS analysis request to an HTTP DNS server based on HTTP, so that after the HTTP DNS server receives the DNS analysis request, determining a target IP address corresponding to the domain name carried in the DNS analysis request based on the corresponding relation between the domain name and the IP address, and sending the target IP address to the HTTP client.
Optionally, the preset protocol is a user datagram protocol UDP, and the preset server is a UDP DNS server;
the step of sending a DNS resolution request to a preset DNS server based on a preset protocol includes:
and sending a DNS analysis request to a UDP DNS server based on UDP, so that after receiving the DNS analysis request, the UDP DNS server obtains a target IP address corresponding to a domain name carried in the DNS analysis request from a standard DNS server and sends the target IP address to the HTTP client.
Optionally, after the step of receiving the response result fed back by the HTTP server, the method further includes:
judging whether the response result is an expected response result;
if the response result is not the expected response result, the step of sending the HTTP request to the HTTP server having the IP address as the target IP address includes:
performing HTTP header encryption operation on the HTTP request to obtain an encrypted HTTP request;
sending an encrypted HTTP request to an HTTP server with an IP address as a target IP address, so that the HTTP server decrypts the encrypted HTTP request after receiving the encrypted HTTP request to obtain a decrypted HTTP request; and responding the decrypted HTTP request to obtain a response result, and feeding back the response result to the HTTP client.
Optionally, the step of sending an HTTP request to an HTTP server whose IP address is a target IP address includes:
monitoring the transmission speed of the HTTP request;
judging whether the transmission speed is less than a preset transmission speed or not;
and if the transmission speed is less than the preset transmission speed, based on a third-party accelerated transmission protocol, sending an HTTP request to an HTTP server with the IP address as a target IP address.
In a second aspect, an embodiment of the present invention provides a request response apparatus, which is applied to an HTTP client, and the apparatus includes:
the system comprises an analysis request sending module, a DNS analysis module and an HTTP client, wherein the analysis request sending module is used for sending a DNS analysis request to a preset DNS server based on a preset protocol so that the preset DNS server analyzes a domain name carried in the DNS analysis request into a target IP address and sends the target IP address to the HTTP client, and the preset protocol is a protocol different from a standard DNS analysis protocol;
the HTTP request sending module is used for sending an HTTP request to an HTTP server with a target IP address as an IP address, so that the HTTP server responds to the HTTP request to obtain a response result, and the response result is fed back to the HTTP client;
and the response result receiving module is used for receiving the response result fed back by the HTTP server.
Optionally, the parsing request sending module is specifically configured to:
and when the DNS server with the judgment standard fails to resolve the domain name into the IP address, sending a DNS resolution request to a preset DNS server based on a preset protocol.
Optionally, the preset protocol is HTTP, and the preset server is an HTTP DNS server;
the analysis request sending module is specifically configured to:
and sending a DNS analysis request to an HTTP DNS server based on HTTP, so that after the HTTP DNS server receives the DNS analysis request, determining a target IP address corresponding to the domain name carried in the DNS analysis request based on the corresponding relation between the domain name and the IP address, and sending the target IP address to the HTTP client.
Optionally, the preset protocol is a user datagram protocol UDP, and the preset server is a UDP DNS server;
the analysis request sending module is specifically configured to:
and sending a DNS analysis request to a UDP DNS server based on UDP, so that after receiving the DNS analysis request, the UDP DNS server obtains a target IP address corresponding to a domain name carried in the DNS analysis request from a standard DNS server and sends the target IP address to the HTTP client.
Optionally, the apparatus further comprises:
a response result judging module, configured to judge whether the response result is an expected response result after the step of receiving the response result fed back by the HTTP server;
if the response result is not the expected response result, the HTTP request sending module is specifically configured to:
performing HTTP header encryption operation on the HTTP request to obtain an encrypted HTTP request;
sending an encrypted HTTP request to an HTTP server with an IP address as a target IP address, so that the HTTP server decrypts the encrypted HTTP request after receiving the encrypted HTTP request to obtain a decrypted HTTP request; and responding the decrypted HTTP request to obtain a response result, and feeding back the response result to the HTTP client.
Optionally, the HTTP request sending module is specifically configured to:
monitoring the transmission speed of the HTTP request;
judging whether the transmission speed is less than a preset transmission speed or not;
and if the transmission speed is less than the preset transmission speed, based on a third-party accelerated transmission protocol, sending an HTTP request to an HTTP server with the IP address as a target IP address.
In a third aspect, an embodiment of the present invention further provides a terminal, where an HTTP client runs in the terminal, and the terminal includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
a processor, configured to implement the request response method according to the first aspect when executing a program stored in a memory.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to execute the request response method of the first aspect.
In another aspect of the present invention, there is also provided a computer program product including instructions, which when run on a computer, causes the computer to execute the bid request response method according to the first aspect.
According to the technical scheme provided by the embodiment of the invention, a DNS analysis request is sent to a preset DNS server based on a preset protocol, wherein the preset protocol is a protocol different from a standard DNS analysis protocol, and the probability of hijacking of the preset protocol is low; after the preset DNS server obtains the DNS analysis request, the domain name carried in the DNS analysis request can be analyzed into a target IP address, and the target IP address is sent to the HTTP client; after receiving the target IP address, the HTTP client can send an HTTP request to an HTTP server with the IP address as the target IP address; and after receiving the HTTP request, the HTTP server responds to the HTTP request to obtain a response result, and feeds the response result back to the HTTP client. Therefore, the technical scheme provided by the embodiment of the invention can improve the probability of obtaining the accurate IP address and the accurate response result of the HTTP client.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart of a request response method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a request response apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In order to solve the technical problems described in the background art, embodiments of the present invention provide a request response method, apparatus, and terminal, so as to improve the probability that an HTTP client obtains an accurate IP address and the probability that an accurate response result is obtained.
In a first aspect, an embodiment of the present invention provides a request response method, which is applied to an HTTP client, where the HTTP client operates in a terminal.
As shown in fig. 1, the request response method provided in the embodiment of the present invention may include the following steps:
s110, a DNS analysis request is sent to a preset DNS server based on a preset protocol, so that the preset DNS server analyzes a domain name carried in the DNS analysis request into a target IP address, and the target IP address is sent to an HTTP client, wherein the preset protocol is a protocol different from a standard DNS analysis protocol.
The HTTP client sends a DNS analysis request to a preset DNS server based on a preset protocol, wherein the preset protocol is a protocol different from a standard DNS analysis protocol, and the preset protocol can be a protocol customized by a developer; because the preset protocol is self-defined by the developer, the probability of hijacking the preset protocol is lower. After receiving the DNS resolution request, the default DNS server may resolve the domain name carried in the DNS resolution request into an accurate IP address, that is, a target IP address, and send the target IP address to the HTTP client.
The preset protocol may be HTTP based on an HTTP request mode, or the preset protocol may also be a user datagram protocol UDP based on a UDP message format, which is reasonable.
In one embodiment, the step of sending the DNS resolution request to the preset DNS server based on the preset protocol may include:
and when the DNS server with the judgment standard fails to resolve the domain name into the IP address, sending a DNS resolution request to a preset DNS server based on a preset protocol.
In this embodiment, the HTTP client may send the DNS resolution request to the standard DNS server based on the standard DNS resolution protocol before sending the DNS resolution request to the preset server based on the preset protocol.
In practical applications, in one case, the HTTP client may receive information such as "domain name resolution error" sent by the standard DNS server, and at this time, the HTTP client may determine that the standard DNS server fails to resolve the domain name into the IP address. The HTTP client may send a DNS resolution request to a preset DNS server based on a preset protocol in order to obtain an accurate IP address.
In another case, the HTTP client may receive an IP address sent by a standard DNS server, at this time, the HTTP client may send an HTTP request to the HTTP server having the IP address, after receiving the HTTP request, the HTTP server may respond to the HTTP request to obtain a response result, and send the response result to the HTTP client, after receiving the response result, the HTTP client may determine whether the response result is an expected response result, and if the response result is not the expected response result, the HTTP client may determine that the domain name is failed to be resolved by the standard DNS server into the IP address. The HTTP client may send a DNS resolution request to a preset DNS server based on a preset protocol in order to obtain an accurate IP address.
For clarity of the description of the scheme, a specific implementation manner of sending the DNS resolution request to the preset DNS server based on the preset protocol will be described in detail in the following embodiments.
S120, an HTTP request is sent to the HTTP server with the IP address as the target IP address, so that the HTTP server responds to the HTTP request, a response result is obtained, and the response result is fed back to the HTTP client.
After obtaining the target IP address, the HTTP client can send an HTTP request to an HTTP server with the IP address as the target IP address, and after obtaining the HTTP request, the HTTP server can respond to the HTTP request to obtain a response result; and feeds back the response result to the HTTP client.
In one embodiment, the step of sending the HTTP request to the HTTP server with the IP address as the target IP address may include:
monitoring the transmission speed of the HTTP request;
judging whether the transmission speed is less than a preset transmission speed or not;
and if the transmission speed is lower than the preset transmission speed, based on a third-party accelerated transmission protocol, sending an HTTP request to an HTTP server with the IP address as a target IP address.
In this embodiment, when the HTTP client sends the HTTP request to the HTTP server, the HTTP request is generally transmitted based on a transmission control protocol TCP, and the transmission speed based on the TCP is slow in the weak network environment, the HTTP client may monitor the transmission speed of the HTTP request and determine whether the transmission speed is less than a preset transmission speed; if the transmission speed is lower than the preset transmission speed, the transmission speed based on the TCP is relatively low, so that the HTTP client can send the HTTP request to the HTTP server with the IP address as the target IP address based on a third-party accelerated transmission protocol, and the transmission speed of the HTTP request can be increased, wherein the third-party accelerated transmission protocol is UDT or KCP, and the third-party accelerated transmission protocol is reasonable.
It should be noted that, in practical applications, during the process of sending the HTTP request to the HTTP server by the HTTP client, the HTTP request may also be hijacked, and therefore, in an embodiment, after the step of receiving the response result fed back by the HTTP server, the request response method may further include:
judging whether the response result is an expected response result;
if the response result is not the expected response result, the step of sending the HTTP request to the HTTP server having the IP address as the target IP address may include:
performing HTTP header encryption operation on the HTTP request to obtain an encrypted HTTP request;
sending the encrypted HTTP request to an HTTP server with the IP address as a target IP address, so that the HTTP server decrypts the encrypted HTTP request after receiving the encrypted HTTP request to obtain a decrypted HTTP request; and responds to the decrypted HTTP request.
In this embodiment, after receiving the response result fed back by the HTTP server, the HTTP client may determine whether the response result is an expected response result; if the response result is not the expected response result, the HTTP request is hijacked in the process that the HTTP client sends the HTTP request to the HTTP server, so that the HTTP client can execute HTTP head encryption operation on the HTTP request to obtain the encrypted HTTP request, and send the encrypted HTTP request to the HTTP server with the IP address as the target IP address, and after receiving the encrypted HTTP request, the HTTP server can decrypt the encrypted HTTP request by adopting decryption operation corresponding to the head encryption operation of the HTTP client to obtain the decrypted HTTP request, respond to the decrypted HTTP request to obtain a response result, and feed the response result back to the HTTP client.
The HTTP client can use a customized encryption algorithm to execute HTTP header encryption operation on the HTTP request, and thus, after the HTTP server receives the encrypted HTTP request, the HTTP server can use a decryption algorithm corresponding to the customized encryption algorithm to decrypt the encrypted HTTP request.
For example, the HTTP client may perform HTTP header encryption operation on the HTTP request in a 3DES encryption manner, and the HTTP server may decrypt the encrypted HTTP request in a 3DES decryption manner after receiving the encrypted HTTP request. The embodiment of the present invention does not specifically limit the manner in which the HTTP client performs the HTTP header encryption operation on the HTTP request, and the manner in which the HTTP server performs the decryption operation on the encrypted HTTP request.
It should be noted that, after the HTTP server responds to the decrypted HTTP request and obtains a response result, the HTTP server may also encrypt the response result to obtain an encrypted response result, and feed back the encrypted response result to the HTTP client, and the HTTP client receives the encrypted response result, and may decrypt the encrypted response result to obtain an accurate response result.
As can be seen from the above description, the HTTP client transmits the encrypted HTTP request to the HTTP server, and the encrypted HTTP request has a low probability of being hijacked or tampered during transmission, so that the HTTP client has a high probability of obtaining an accurate response result. Moreover, the HTTP client executes HTTP header encryption operation on the HTTP request, so that resources consumed by executing additional encryption and decryption operations are reduced.
And S130, receiving a response result fed back by the HTTP server.
And after the HTTP server obtains the response result, the HTTP server feeds back the response result to the HTTP client, so that the HTTP client can obtain the response result.
According to the technical scheme provided by the embodiment of the invention, a DNS analysis request is sent to a preset DNS server based on a preset protocol, wherein the preset protocol is a protocol different from a standard DNS analysis protocol, and the probability of hijacking of the preset protocol is low; after the preset DNS server obtains the DNS analysis request, the domain name carried in the DNS analysis request can be analyzed into a target IP address, and the target IP address is sent to the HTTP client; after receiving the target IP address, the HTTP client can send an HTTP request to an HTTP server with the IP address as the target IP address; and after receiving the HTTP request, the HTTP server responds to the HTTP request to obtain a response result, and feeds the response result back to the HTTP client. Therefore, the technical scheme provided by the embodiment of the invention can improve the probability of obtaining the accurate IP address and the probability of obtaining the accurate response result by the HTTP client.
For clarity of the description of the scheme, a specific implementation manner of sending the DNS resolution request to the preset DNS server based on the preset protocol will be described in detail in the following embodiments.
In one embodiment, the preset protocol is HTTP, and the preset server is an HTTP DNS server;
in this embodiment, the step of sending the DNS resolution request to the preset DNS server based on the preset protocol may include:
and sending a DNS analysis request to an HTTP DNS server based on HTTP, so that after the HTTP DNS server receives the DNS analysis request, determining a target IP address corresponding to the domain name carried in the DNS analysis request based on the corresponding relation between the domain name and the IP address, and sending the target IP address to the HTTP client.
In this embodiment, since the preset protocol is HTTP, the preset server is an HTTP DNS server, and the HTTP DNS server stores a corresponding relationship between a domain name and an IP address, the HTTP client may send a DNS resolution request to the HTTP DNS server based on HTTP, and after receiving the DNS resolution request, the HTTP DNS server may search for a target IP address corresponding to the domain name carried in the DNS resolution request based on the corresponding relationship between the domain name and the IP address, and send the target IP address to the HTTP client.
For example, the DNS resolution request is: the method comprises the following steps of http:// xxxx/ddn ═ www.iqiyi.com, wherein xxxx is a preset DNS server, www.iqiyi.com is a domain name to be resolved, and a target IP address corresponding to the domain name carried in the DNS resolution request is as follows: 111.206.13.62, respectively; 111.206.13.61.
in another embodiment, the preset protocol is a user datagram protocol UDP, and the preset server is a UDP DNS server;
the step of sending a DNS resolution request to a preset DNS server based on a preset protocol may include:
and sending a DNS analysis request to a UDP DNS server based on UDP, so that after receiving the DNS analysis request, the UDP DNS server acquires a target IP address corresponding to the domain name carried in the DNS analysis request from a standard DNS server and sends the target IP address to the HTTP client.
In this embodiment, since the preset protocol is the user datagram protocol UDP, the preset server is a UDP DNS server, and the UDP DNS server is used as a proxy server, and the target IP address corresponding to the domain name carried in the DNS resolution request can be acquired from a standard DNS server. Therefore, the HTTP client may send a DNS resolution request to the UDP DNS server based on UDP, and after receiving the DNS resolution request, the UDP DNS server may search for a target IP address corresponding to a domain name carried in the DNS resolution request based on a correspondence between the domain name and the IP address, and send the target IP address to the HTTP client.
In a second aspect, an embodiment of the present invention provides a request response apparatus, as shown in fig. 2, applied to an HTTP client, where the apparatus includes:
an analysis request sending module 210, configured to send a DNS analysis request to a preset DNS server based on a preset protocol, so that the preset DNS server analyzes a domain name carried in the DNS analysis request into a target IP address, and sends the target IP address to the HTTP client, where the preset protocol is a protocol different from a standard DNS analysis protocol;
an HTTP request sending module 220 that sends an HTTP request to an HTTP server having a target IP address, so that the HTTP server responds to the HTTP request to obtain a response result, and feeds back the response result to the HTTP client;
a response result receiving module 230, configured to receive a response result fed back by the HTTP server.
Optionally, the parsing request sending module is specifically configured to:
and when the DNS server with the judgment standard fails to resolve the domain name into the IP address, sending a DNS resolution request to a preset DNS server based on a preset protocol.
Optionally, the preset protocol is HTTP, and the preset server is an HTTP DNS server;
the analysis request sending module is specifically configured to:
and sending a DNS analysis request to an HTTP DNS server based on HTTP, so that after the HTTP DNS server receives the DNS analysis request, determining a target IP address corresponding to the domain name carried in the DNS analysis request based on the corresponding relation between the domain name and the IP address, and sending the target IP address to the HTTP client.
Optionally, the preset protocol is a user datagram protocol UDP, and the preset server is a UDP DNS server;
the analysis request sending module is specifically configured to:
and sending a DNS analysis request to a UDP DNS server based on UDP, so that after receiving the DNS analysis request, the UDP DNS server obtains a target IP address corresponding to a domain name carried in the DNS analysis request from a standard DNS server and sends the target IP address to the HTTP client.
Optionally, the apparatus further comprises:
a response result judging module, configured to, after the step of receiving the response result fed back by the HTTP server, judge whether the response result is an expected response result;
if the response result is not the expected response result, the HTTP request sending module is specifically configured to:
performing HTTP header encryption operation on the HTTP request to obtain an encrypted HTTP request;
sending an encrypted HTTP request to an HTTP server with an IP address as a target IP address, so that the HTTP server decrypts the encrypted HTTP request after receiving the encrypted HTTP request to obtain a decrypted HTTP request; and responding the decrypted HTTP request to obtain a response result, and feeding back the response result to the HTTP client.
Optionally, the HTTP request sending module is specifically configured to:
monitoring the transmission speed of the HTTP request;
judging whether the transmission speed is less than a preset transmission speed or not;
and if the transmission speed is less than the preset transmission speed, based on a third-party accelerated transmission protocol, sending an HTTP request to an HTTP server with the IP address as a target IP address.
In a third aspect, an embodiment of the present invention further provides a terminal, where an HTTP client runs in the terminal, as shown in fig. 3, the terminal may include a processor 301, a communication interface 302, a memory 303, and a communication bus 304, where the processor 301, the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304,
a memory 303 for storing a computer program;
the processor 301 is configured to implement the request response method according to the first aspect when executing the program stored in the memory 303.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
According to the technical scheme provided by the embodiment of the invention, a DNS analysis request is sent to a preset DNS server based on a preset protocol, wherein the preset protocol is a protocol different from a standard DNS analysis protocol, and the probability of hijacking of the preset protocol is low; after the preset DNS server obtains the DNS analysis request, the domain name carried in the DNS analysis request can be analyzed into a target IP address, and the target IP address is sent to the HTTP client; after receiving the target IP address, the HTTP client can send an HTTP request to an HTTP server with the IP address as the target IP address; and after receiving the HTTP request, the HTTP server responds to the HTTP request to obtain a response result, and feeds the response result back to the HTTP client. Therefore, the technical scheme provided by the embodiment of the invention can improve the probability of obtaining the accurate IP address and the probability of obtaining the accurate response result by the HTTP client.
In a fourth aspect, in a further embodiment provided by the present invention, there is also provided a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the request response method described in any of the above embodiments.
According to the technical scheme provided by the embodiment of the invention, a DNS analysis request is sent to a preset DNS server based on a preset protocol, wherein the preset protocol is a protocol different from a standard DNS analysis protocol, and the probability of hijacking of the preset protocol is low; after the preset DNS server obtains the DNS analysis request, the domain name carried in the DNS analysis request can be analyzed into a target IP address, and the target IP address is sent to the HTTP client; after receiving the target IP address, the HTTP client can send an HTTP request to an HTTP server with the IP address as the target IP address; and after receiving the HTTP request, the HTTP server responds to the HTTP request to obtain a response result, and feeds the response result back to the HTTP client. Therefore, the technical scheme provided by the embodiment of the invention can improve the probability of obtaining the accurate IP address and the probability of obtaining the accurate response result by the HTTP client.
In a fifth aspect, in a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the request response method described in any of the above embodiments.
According to the technical scheme provided by the embodiment of the invention, a DNS analysis request is sent to a preset DNS server based on a preset protocol, wherein the preset protocol is a protocol different from a standard DNS analysis protocol, and the probability of hijacking of the preset protocol is low; after the preset DNS server obtains the DNS analysis request, the domain name carried in the DNS analysis request can be analyzed into a target IP address, and the target IP address is sent to the HTTP client; after receiving the target IP address, the HTTP client can send an HTTP request to an HTTP server with the IP address as the target IP address; and after receiving the HTTP request, the HTTP server responds to the HTTP request to obtain a response result, and feeds the response result back to the HTTP client. Therefore, the technical scheme provided by the embodiment of the invention can improve the probability of obtaining the accurate IP address and the accurate response result of the HTTP client.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the storage medium and the computer program product embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (11)
1. A request response method applied to an HTTP client, the method comprising:
sending a DNS resolution request to a preset DNS server based on a preset protocol, so that the preset DNS server resolves a domain name carried in the DNS resolution request into a target IP address, and sends the target IP address to the HTTP client, wherein the preset protocol is a protocol different from a standard DNS resolution protocol;
sending an HTTP request to an HTTP server with an IP address as a target IP address, so that the HTTP server responds to the HTTP request to obtain a response result, and feeding the response result back to the HTTP client;
receiving a response result fed back by the HTTP server;
after the step of receiving the response result fed back by the HTTP server, the method further includes:
judging whether the response result is an expected response result;
if the response result is not the expected response result, the step of sending the HTTP request to the HTTP server having the IP address as the target IP address includes:
performing HTTP header encryption operation on the HTTP request to obtain an encrypted HTTP request;
sending an encrypted HTTP request to an HTTP server with an IP address as a target IP address, so that the HTTP server decrypts the encrypted HTTP request after receiving the encrypted HTTP request to obtain a decrypted HTTP request; and responding the decrypted HTTP request to obtain a response result, and feeding back the response result to the HTTP client.
2. The method according to claim 1, wherein the step of sending the DNS resolution request to the predetermined DNS server based on the predetermined protocol comprises:
and when the DNS server with the judgment standard fails to resolve the domain name into the IP address, sending a DNS resolution request to a preset DNS server based on a preset protocol.
3. The method of claim 1, wherein the predetermined protocol is HTTP and the predetermined DNS server is an HTTP DNS server;
the step of sending a DNS resolution request to a preset DNS server based on a preset protocol includes:
and sending a DNS analysis request to an HTTP DNS server based on HTTP, so that after the HTTP DNS server receives the DNS analysis request, determining a target IP address corresponding to the domain name carried in the DNS analysis request based on the corresponding relation between the domain name and the IP address, and sending the target IP address to the HTTP client.
4. The method of claim 1, wherein the predetermined protocol is a User Datagram Protocol (UDP), and the predetermined DNS server is a UDP DNS server;
the step of sending a DNS resolution request to a preset DNS server based on a preset protocol includes:
and sending a DNS analysis request to a UDP DNS server based on UDP, so that after receiving the DNS analysis request, the UDP DNS server obtains a target IP address corresponding to a domain name carried in the DNS analysis request from a standard DNS server and sends the target IP address to the HTTP client.
5. The method according to any one of claims 1 to 4, wherein the step of sending an HTTP request to an HTTP server having a target IP address comprises:
monitoring the transmission speed of the HTTP request;
judging whether the transmission speed is less than a preset transmission speed or not;
and if the transmission speed is less than the preset transmission speed, based on a third-party accelerated transmission protocol, sending an HTTP request to an HTTP server with the IP address as a target IP address.
6. A request response apparatus, applied to an HTTP client, the apparatus comprising:
the system comprises an analysis request sending module and an HTTP client, wherein the analysis request sending module is used for sending a DNS analysis request to a preset DNS server based on a preset protocol so that the preset DNS server can analyze a domain name carried in the DNS analysis request into a target IP address and send the target IP address to the HTTP client, and the preset protocol is a protocol different from a standard DNS analysis protocol;
the HTTP request sending module is used for sending an HTTP request to an HTTP server with an IP address as a target IP address so that the HTTP server responds to the HTTP request to obtain a response result, and the response result is fed back to the HTTP client;
a response result receiving module, configured to receive a response result fed back by the HTTP server;
a response result judging module, configured to, after the step of receiving the response result fed back by the HTTP server, judge whether the response result is an expected response result;
if the response result is not an expected response result, the HTTP request sending module is specifically configured to:
performing HTTP header encryption operation on the HTTP request to obtain an encrypted HTTP request;
sending an encrypted HTTP request to an HTTP server with an IP address as a target IP address, so that the HTTP server decrypts the encrypted HTTP request after receiving the encrypted HTTP request to obtain a decrypted HTTP request; and responding the decrypted HTTP request to obtain a response result, and feeding back the response result to the HTTP client.
7. The apparatus of claim 6, wherein the parsing request sending module is specifically configured to:
and when the DNS server with the judgment standard fails to resolve the domain name into the IP address, sending a DNS resolution request to a preset DNS server based on a preset protocol.
8. The apparatus of claim 6, wherein the predetermined protocol is HTTP, and wherein the predetermined DNS server is an HTTP DNS server;
the analysis request sending module is specifically configured to:
and sending a DNS analysis request to an HTTP DNS server based on HTTP, so that after the HTTP DNS server receives the DNS analysis request, determining a target IP address corresponding to the domain name carried in the DNS analysis request based on the corresponding relation between the domain name and the IP address, and sending the target IP address to the HTTP client.
9. The apparatus of claim 6, wherein the predetermined protocol is a User Datagram Protocol (UDP), and the predetermined DNS server is a UDP DNS server;
the analysis request sending module is specifically configured to:
and sending a DNS analysis request to a UDP DNS server based on UDP, so that after receiving the DNS analysis request, the UDP DNS server obtains a target IP address corresponding to a domain name carried in the DNS analysis request from a standard DNS server and sends the target IP address to the HTTP client.
10. The apparatus according to any one of claims 6 to 9, wherein the HTTP request sending module is specifically configured to:
monitoring the transmission speed of the HTTP request;
judging whether the transmission speed is less than a preset transmission speed or not;
and if the transmission speed is less than the preset transmission speed, based on a third-party accelerated transmission protocol, sending an HTTP request to an HTTP server with the IP address as a target IP address.
11. A terminal is characterized in that an HTTP client runs in the terminal and comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are used for completing mutual communication through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910300213.9A CN110113440B (en) | 2019-04-15 | 2019-04-15 | Request response method, device and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910300213.9A CN110113440B (en) | 2019-04-15 | 2019-04-15 | Request response method, device and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110113440A CN110113440A (en) | 2019-08-09 |
CN110113440B true CN110113440B (en) | 2022-06-03 |
Family
ID=67483863
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910300213.9A Active CN110113440B (en) | 2019-04-15 | 2019-04-15 | Request response method, device and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110113440B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111343299B (en) * | 2020-03-12 | 2022-07-05 | 宋磊 | Multi-protocol active detection type intelligent DNS and method thereof |
CN111931083B (en) * | 2020-06-30 | 2023-07-25 | 北京奇艺世纪科技有限公司 | Webpage loading method and device, terminal equipment and readable storage medium |
CN111917511B (en) * | 2020-07-06 | 2024-01-30 | 青岛海尔科技有限公司 | Data receiving method |
CN114051016B (en) * | 2022-01-12 | 2022-04-12 | 满金坝(深圳)科技有限公司 | IP intelligent matching method of mobile terminal in HTTP request and mobile terminal |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102904959A (en) * | 2012-10-19 | 2013-01-30 | 李恺 | Network accelerating method and gateway |
CN104994079A (en) * | 2015-06-10 | 2015-10-21 | 网宿科技股份有限公司 | Access request processing method, access request processing device and acceleration server |
CN105100294A (en) * | 2014-05-20 | 2015-11-25 | 阿里巴巴集团控股有限公司 | Webpage acquiring method, system, network server, browser and GSLB |
CN108574660A (en) * | 2017-03-09 | 2018-09-25 | 武汉斗鱼网络科技有限公司 | A kind of method and system obtaining IP address |
CN109413219A (en) * | 2017-08-15 | 2019-03-01 | 广州市动景计算机科技有限公司 | A kind of domain name analytic method and device, server and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104901943A (en) * | 2012-03-31 | 2015-09-09 | 北京奇虎科技有限公司 | Method and system for accessing website |
-
2019
- 2019-04-15 CN CN201910300213.9A patent/CN110113440B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102904959A (en) * | 2012-10-19 | 2013-01-30 | 李恺 | Network accelerating method and gateway |
CN105100294A (en) * | 2014-05-20 | 2015-11-25 | 阿里巴巴集团控股有限公司 | Webpage acquiring method, system, network server, browser and GSLB |
CN104994079A (en) * | 2015-06-10 | 2015-10-21 | 网宿科技股份有限公司 | Access request processing method, access request processing device and acceleration server |
CN108574660A (en) * | 2017-03-09 | 2018-09-25 | 武汉斗鱼网络科技有限公司 | A kind of method and system obtaining IP address |
CN109413219A (en) * | 2017-08-15 | 2019-03-01 | 广州市动景计算机科技有限公司 | A kind of domain name analytic method and device, server and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110113440A (en) | 2019-08-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110113440B (en) | Request response method, device and terminal | |
US10122746B1 (en) | Correlation and consolidation of analytic data for holistic view of malware attack | |
US11277418B2 (en) | Network attack determination method, secure network data transmission method, and corresponding apparatus | |
US9578040B2 (en) | Packet receiving method, deep packet inspection device and system | |
US9648033B2 (en) | System for detecting the presence of rogue domain name service providers through passive monitoring | |
CN109802936B (en) | Network data access method and device and electronic equipment | |
US9576064B2 (en) | Third party program integrity and integration control in web-based applications | |
CN107360187B (en) | Network hijacking processing method, device and system | |
CN112929241B (en) | Network testing method and device | |
CN108076003B (en) | Session hijacking detection method and device | |
CN108777679B (en) | Method and device for generating traffic access relation of terminal and readable storage medium | |
CN110727588B (en) | Network application testing method, system, computer equipment and readable storage medium | |
CN111711533A (en) | Fault diagnosis method, fault diagnosis device, electronic equipment and storage medium | |
US20210192563A1 (en) | Webpage advertisement anti-blocking method, content delivery network, and client terminal | |
CN111371889B (en) | Message processing method and device, internet of things system and storage medium | |
TW201733314A (en) | Method for executing request and associated server | |
CN113438336B (en) | Network request method, device, equipment and storage medium | |
CN114157485A (en) | Resource access method and device and electronic equipment | |
CN107094134A (en) | A kind of method and client of access website | |
CN113179317A (en) | Test system and method for content rewriting device | |
CN111782418A (en) | Data attribution method and device, electronic equipment and computer readable medium | |
CN113285920B (en) | Service access method, device, equipment and storage medium | |
CN114116448A (en) | Pressure testing method and device of application program, storage medium and computer equipment | |
US8131822B2 (en) | Access of elements for a secure web page through a non-secure channel | |
CN111917787A (en) | Request detection method and device, electronic equipment and computer-readable 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 |