CN111225038A - Server access method and device - Google Patents

Server access method and device Download PDF

Info

Publication number
CN111225038A
CN111225038A CN201911340085.7A CN201911340085A CN111225038A CN 111225038 A CN111225038 A CN 111225038A CN 201911340085 A CN201911340085 A CN 201911340085A CN 111225038 A CN111225038 A CN 111225038A
Authority
CN
China
Prior art keywords
field
character string
string
http
http request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911340085.7A
Other languages
Chinese (zh)
Other versions
CN111225038B (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.)
Hillstone Networks Corp
Original Assignee
Hillstone Networks Corp
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 Hillstone Networks Corp filed Critical Hillstone Networks Corp
Priority to CN201911340085.7A priority Critical patent/CN111225038B/en
Publication of CN111225038A publication Critical patent/CN111225038A/en
Application granted granted Critical
Publication of CN111225038B publication Critical patent/CN111225038B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/741Routing in networks with a plurality of addressing schemes, e.g. with both IPv4 and IPv6
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/251Translation of Internet protocol [IP] addresses between different IP versions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content

Abstract

The invention discloses a server access method and device. Wherein, the method comprises the following steps: receiving a first hypertext transfer protocol (HTTP) request; determining whether a first HOST field of the first HTTP request is configured with a first string, wherein the first string is used to identify the content of the first HOST field; configuring a second string for a second HOST field of a second HTTP request if the first string is configured in the first HOST field, wherein the second string is used to identify the content of the second HOST field; and transmitting the second HTTP request to an IPv4 server after the second string is configured for the second HOST field. The invention solves the technical problem that the IPv4 server prevents access because the domain name of the HTTP request is the IPv6 address in the HTTP communication process of the IPv6 client and the IPv4 server.

Description

Server access method and device
Technical Field
The invention relates to the technical field of computers, in particular to a server access method and device.
Background
With the popularization of IPv6(Internet Protocol Version 6) technology, more and more IPv4 websites need to support the request of IPv6 terminals. In the existing technical scheme, a proxy server is used for proxy of an IPv6 client to communicate with an HTTP (hyper Text Transfer protocol) of an IPv4 server, the IPv6 client initiates a domain name access request to the proxy server, a domain name resolution server resolves a domain name of a website, obtains an IPv6 address of the website and sends the IPv6 address to the IPv6 client, the IPv6 client sends an HTTP request to the IPv6 address to the proxy server, and after the proxy server resolves the request, the proxy server sends the IPv6 address to a HOST field stored in the HTTP request and sends the HOST field to the IPv4 server, and at this time, due to the configuration of the IPv4 server or the presence of devices such as a WAF, the HOST field is considered to be an IPv6 address illegal, and a 400 error is returned, and if a reference field or a LOCATION field contains a domain name of an IP address type, similar problems also exist.
If the problems in the prior art need to be repaired, or the rules of security devices such as the WAF and the like are modified, security problems can be caused; or a plurality of rewriting rules are configured for each field on the proxy server, and the response returned by the IPv4 server is processed in the rules, so that the process is complicated, the logic is complex, and the practicability is low.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a server access method and a server access device, which are used for at least solving the technical problem that an IPv4 server prevents access because a domain name of an HTTP request is an IPv6 address in the process of HTTP communication between an IPv6 client and an IPv4 server.
According to an aspect of an embodiment of the present invention, there is provided a server access method, including: receiving a first hypertext transfer protocol (HTTP) request; determining whether a first HOST field of the first HTTP request is configured with a first string, wherein the first string is used to identify the content of the first HOST field; configuring a second string for a second HOST field of a second HTTP request if the first string is configured in the first HOST field, wherein the second string is used to identify the content of the second HOST field; and transmitting the second HTTP request to an IPv4 server after the second string is configured for the second HOST field.
Optionally, configuring a second character string for the second HOST field of the second HTTP request includes: and changing the domain name character string in the second HOST field to the second character string.
Optionally, before sending the second HTTP request to the IPv4 server, the method further includes: judging whether a first REFERER field of the first HTTP request is configured with the first character string, wherein the first character string is also used for identifying the content of the first REFERER field; and if the first character string is configured in the REFERER field, configuring the second character string for a second REFERER field of a second HTTP request, wherein the second character string is also used for identifying the content of the second REFERER field.
Optionally, after sending the second HTTP request to the IPv4 server, the method further includes: detecting whether a first HTTP response returned by the IPv4 server is received or not; judging whether the second character string is configured in a first webpage address field of the first HTTP response or not when the first HTTP response is received; if the first response head field is configured with the second character string, configuring a first character string for a second webpage address field of a second HTTP response; and after the first character string is configured for the second webpage address field, sending the second HTTP response to the IPv6 client.
Optionally, before configuring the first character string for the second response header field of the second HTTP response, the method further includes: detecting whether the first HOST field is configured with the first character string; if the first HOST field is detected to be configured with the first character string, executing the step of configuring the first character string for a second webpage address field of a second HTTP response; configuring the first character string for a second webpage address field of a second HTTP response, comprising: and changing the domain name character string in the second webpage address field into the first character string.
Optionally, the first HTTP request is an HTTP request sent by an IPv6 client to a proxy server, and the second HTTP request is an HTTP request sent by the proxy server to the IPv4 server.
According to another aspect of the embodiments of the present invention, there is also provided a server access apparatus, including: the first communication module is used for receiving a first hypertext transfer protocol (HTTP) request; a first determining module, configured to determine whether a first HOST field of the first HTTP request is configured with a first character string, where the first character string is used to identify content of the first HOST field; a first configuration module, configured to configure a second string for a second HOST field of a second HTTP request if the first HOST field is configured with the first string, wherein the second string is used to identify content of the second HOST field; and a second communication module, configured to send the second HTTP request to an IPv4 server after configuring the second character string for the second HOST field.
Optionally, the apparatus further comprises: a first detection module, configured to detect whether a first HTTP response returned by the IPv4 server is received; a second judging module, configured to, in a case where the first HTTP response is received, judge whether a second character string is configured in a first webpage address field of the first HTTP response; a second configuration module, configured to configure the first character string for a second webpage address field of a second HTTP response if the second character string is configured for the first webpage address field; and a third communication module, configured to send the second HTTP response to the IPv6 client after configuring the first character string for the second web address field.
Optionally, the apparatus further comprises: a second detection module, configured to detect whether the first HOST field is configured with the first character string; executing the second configuration module if the first HOST field is configured with the first character string; the second configuration module is further configured to change the domain name character string in the second web page address field to the first character string.
Optionally, the apparatus further comprises: a third determining module, configured to determine whether a first referr field of the first HTTP request is configured with the first character string, where the first character string is further used to identify content of the first referr field; a third configuration module, configured to configure the second character string for a second referr field of a second HTTP request if the referr field is configured with the first character string, where the second character string is further used to identify content of the second referr field.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium, where the storage medium includes a stored program, and when the program runs, the apparatus on which the storage medium is located is controlled to execute any one of the above server access methods.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program, where the program executes any one of the server access methods described above.
In an embodiment of the invention, the method comprises the steps of receiving a first hypertext transfer protocol (HTTP) request; determining whether a first HOST field of the first HTTP request is configured with a first string, wherein the first string is used to identify the content of the first HOST field; configuring a second string for a second HOST field of a second HTTP request if the first string is configured in the first HOST field, wherein the second string is used to identify the content of the second HOST field; and transmitting the second HTTP request to an IPv4 server after the second string is configured for the second HOST field.
Therefore, the embodiment of the application achieves the aim of realizing normal HTTP communication between the IPv6 client and the IPv4 server through a simple and convenient configuration method, thereby realizing the technical effect of avoiding the phenomenon that the IPv4 server prevents access because the domain name of the HTTP request is the IPv6 address, and further solving the technical problem that the IPv4 server prevents access because the domain name of the HTTP request is the IPv6 address in the HTTP communication process between the IPv6 client and the IPv4 server.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a server access method according to an embodiment of the present invention;
FIG. 2 is a flow chart of an alternative server access method according to an embodiment of the invention;
fig. 3 is a schematic structural diagram of a server access device according to an embodiment of the present invention.
Detailed Description
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.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those 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.
First, in order to facilitate understanding of the embodiments of the present invention, some terms or nouns referred to in the present invention will be explained as follows:
IPv 6: the next generation IP protocol, which is used in place of IPv4, may be numbered with one address for each sand worldwide.
HOST: a "destination server domain name" or a "destination server hostname".
REFERER: for short, the external chain is used, some pictures on the webpage come from other websites, for example, pictures of the Xinlang come from hundredth degrees, the Xinlang refers to the pictures of one hundred degrees by using the external chain, and the server of the Xinlang does not store the pictures.
Example 1
In accordance with an embodiment of the present invention, there is provided an embodiment of a server access method, it should be noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a flowchart of a server access method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, receiving a first hypertext transfer protocol (HTTP) request;
step S104, determining whether a first character string is configured in a first HOST field of the first HTTP request, wherein the first character string is used to identify the content of the first HOST field;
step S106, if the first HOST field is configured with the first character string, configuring a second character string for a second HOST field of a second HTTP request, wherein the second character string is used for identifying the content of the second HOST field;
step S108 is performed to transmit the second HTTP request to an IPv4 server after the second character string is configured for the second HOST field.
In an embodiment of the invention, the method comprises the steps of receiving a first hypertext transfer protocol (HTTP) request; determining whether a first HOST field of the first HTTP request is configured with a first string, wherein the first string is used to identify the content of the first HOST field; configuring a second string for a second HOST field of a second HTTP request if the first string is configured in the first HOST field, wherein the second string is used to identify the content of the second HOST field; and transmitting the second HTTP request to an IPv4 server after the second string is configured for the second HOST field.
Therefore, the embodiment of the application achieves the aim of realizing normal HTTP communication between the IPv6 client and the IPv4 server through a simple and convenient configuration method, thereby realizing the technical effect of avoiding the phenomenon that the IPv4 server prevents access because the domain name of the HTTP request is the IPv6 address, and further solving the technical problem that the IPv4 server prevents access because the domain name of the HTTP request is the IPv6 address in the HTTP communication process between the IPv6 client and the IPv4 server.
Optionally, the execution subject in the embodiment of the present application may be, but is not limited to, a proxy server. The first HTTP request is an HTTP request sent by an IPv6 client to a proxy server, and the second HTTP request is an HTTP request sent by the proxy server to the IPv4 server.
Optionally, the first string is used to identify the content of the first HOST field (hostname of destination server), i.e. matching string original-string; the second string is used to identify the content of the second HOST field, i.e., to overwrite the string target-string.
In an alternative embodiment, after receiving a first HTTP request, a proxy server determines whether a first string is configured in a first HOST field of the first HTTP request, configures a second string for a second HOST field of a second HTTP request if the first string is configured in the first HOST field, and transmits the second HTTP request to an IPv4 server after configuring the second string for the second HOST field.
As an alternative embodiment, in the following example, a first HTTP request initiated by an IPv6 client to a proxy server is referred to as HTTP1, where a HOST field in HTTP1 is referred to as HOST1, and a second HTTP request initiated by the proxy server to an IPv4 server is referred to as HTTP2, where a HOST field in HTTP2 is referred to as HOST 2. In the following example, the first string is original-string and the second string is target-string.
As an alternative embodiment, after receiving the first HTTP request sent by the IPv6 client, the proxy server determines whether the first HOST field HOST1 of the first HTTP request HTTP1 has the first string original-string configured, and if the first HOST field HOST1 has the first string original-string configured, configures the second HOST field HOST2 of the second HTTP request HTTP2 with the second string target-string, and after configuring the second string target-string for the second HOST field HTTP2, sends the second HTTP request HTTP2 to the IPv4 server.
In an optional embodiment, configuring a second string for the second HOST field of the second HTTP request includes: and changing the domain name character string in the second HOST field to the second character string.
Optionally, before sending the second HTTP request to the IPv4 server, the method further includes: judging whether a first REFERER field of the first HTTP request is configured with the first character string, wherein the first character string is also used for identifying the content of the first REFERER field; and if the first character string is configured in the REFERER field, configuring the second character string for a second REFERER field of a second HTTP request, wherein the second character string is also used for identifying the content of the second REFERER field.
Optionally, in this embodiment, before sending the second HTTP request to the IPv4 server, it is determined whether or not a first string is arranged in the first HOST field of the first HTTP request, and if a first string original-string is arranged in the first HOST field, it is determined whether or not a second string target-string is arranged in the second HOST field of the second HTTP request if the first string original-string is arranged in the referr field, and it is also determined whether or not the first string original-string is arranged in the first referr field of the first HTTP request before sending the second HTTP request to the IPv4 server, and if the first string original-string is arranged in the referr field, it is determined that the second string target-string is arranged in the second referr field of the second HTTP request.
In an alternative embodiment, the first HTTP request is a request based on the IPv6 address sent by the IPv6 client.
In an optional embodiment, optionally, configuring the second string target-string for a second reference field of a second HTTP request includes: and changing the domain name character string in the second reference field to the second character string target-string.
In an alternative embodiment, fig. 2 is a flowchart of an alternative server access method according to an embodiment of the present invention, and as shown in fig. 2, after sending the second HTTP request to an IPv4 server, the method further includes:
step S302, detecting whether a first HTTP response returned by the IPv4 server is received or not;
step S304, under the condition of receiving the first HTTP response, judging whether a first webpage address field of the first HTTP response is configured with a second character string;
step S306, if the first response header field is configured with the second character string, configuring a first character string for a second web address field of a second HTTP response;
step S308, after configuring the first character string for the second web page address field, sending the second HTTP response to the IPv6 client.
As an optional embodiment, before configuring the first character string for the second web page address field of the second HTTP response, the method further includes:
step S402, detecting whether the first HOST field is configured with the first string;
step S404, if it is detected that the first character string is configured in the first HOST field, performing the step of configuring the first character string for the second web address field of the second HTTP response;
as another alternative embodiment, configuring the first character string for the second web page address field of the second HTTP response includes: and changing the domain name character string in the second webpage address field into the first character string.
In the above optional embodiment, if the proxy server receives a first HTTP response returned by the IPv4 server, it is determined whether a first webpage address field (i.e., a LOCATION field) of the first HTTP response is configured with a second string target-string; detecting whether or not the first HOST field HOST1 corresponding to the second web address field has the first string original-string arranged if the first web address field has the second string target-string arranged therein; when the first string original-string is detected to be placed in the first HOST field HOST1, the domain name string in the second web address field (i.e., LOCATION field) is changed to the first string target-string.
As an alternative embodiment, the interaction subject of the server access method provided in the embodiment of the present application may include, but is not limited to: the system comprises an IPv6 client, a proxy server and an IPv4 server, wherein the IPv6 client carries out HTTP communication with the IPv4 server through the proxy server; wherein, the first character string original-string is prearranged as [2001::1], the second character string target-string is 10.1.2.3; the method may be implemented by, but is not limited to, the following program code configurations:
first, the first HTTP request sent by the IPv6 client and received by the proxy server can be implemented by the following program code configurations:
GET/a.html HTTP/1.1
Host:[2001::1]
User-Agent:curl/7.57.0
Accept:*/*
Referer:[2001::1]/test.html
second, the second HTTP request initiated by the proxy server to the IPv4 server may be implemented by the following program code configuration:
GET/a.html HTTP/1.1
Host:10.1.2.3
User-Agent:curl/7.57.0
Accept:*/*
Referer:10.1.2.3/test.html
third, the first HTTP response returned by the IPv4 server to the proxy server can be implemented by the following program code configuration:
Connection:keep-alive
Content-Length:258
Content-Type:text/html
Date:Thu,07Mar 2019 08:36:22GMT
Location:https://10.1.2.3/text/a.html
Server:Tengine
fourthly, the second HTTP response returned by the proxy server to the IPv6 client can be implemented by the following program code configurations:
Connection:keep-alive
Content-Length:258
Content-Type:text/html
Date:Thu,07Mar 2019 08:36:22GMT
Location:https://[2001::1]/text/a.html
Server:Tengine
in the embodiment of the application, only one matching character string original-string (namely, only one first character string is configured when a request is made) and one rewriting character string target-string (namely, only one second character string is configured when the request is made) need to be configured when an IPv6 client requests to access an IPv4 server, namely, the proxy server does not need to modify field by field, and the HOST2 can be legal by rewriting HTTP request headers (rewriting HTTP response headers when responding), so that the server is prevented from being accessed because the domain name of the HTTP request is an IPv6 address, normal HTTP communication can be carried out between the IPv6 client and the IPv4 server through the proxy server, the problem of access failure caused by illegal HTTP header fields is not worried, and the rewriting of the HOST field, the REFERER field and the LOCATION field can be processed simultaneously only by simple configuration.
Example 2
According to an embodiment of the present invention, an embodiment of an apparatus for implementing the server access method is further provided, and fig. 3 is a schematic structural diagram of a server access apparatus according to an embodiment of the present invention, as shown in fig. 3, the server access apparatus includes: a first communication module 40, a first determination module 42, a first configuration module 44, and a second communication module 46, wherein:
a first communication module 40, configured to receive a first hypertext transfer protocol HTTP request; a first determining module 42, configured to determine whether a first HOST field of the first HTTP request is configured with a first character string, where the first character string is used to identify content of the first HOST field; a first configuration module 44, configured to configure a second string for a second HOST field of a second HTTP request if the first HOST field is configured with the first string, where the second string is used to identify the content of the second HOST field; a second communication module 46, configured to send the second HTTP request to an IPv4 server after configuring the second character string for the second HOST field.
Optionally, the apparatus further comprises: a first detection module, configured to detect whether a first HTTP response returned by the IPv4 server is received; a second judging module, configured to, in a case where the first HTTP response is received, judge whether a second character string is configured in a first webpage address field of the first HTTP response; a second configuration module, configured to configure the first character string for a second webpage address field of a second HTTP response if the second character string is configured for the first webpage address field; and a third communication module, configured to send the second HTTP response to the IPv6 client after configuring the first character string for the second web address field.
Optionally, the apparatus further comprises: a second detection module, configured to detect whether the first HOST field is configured with the first character string; executing the second configuration module if the first HOST field is configured with the first character string; the second configuration module is further configured to change the domain name character string in the second web page address field to the first character string.
Optionally, the apparatus further comprises: a third determining module, configured to determine whether a first referr field of the first HTTP request is configured with the first character string, where the first character string is further used to identify content of the first referr field; a third configuration module, configured to configure the second character string for a second referr field of a second HTTP request if the referr field is configured with the first character string, where the second character string is further used to identify content of the second referr field.
It should be noted that the above modules may be implemented by software or hardware, for example, for the latter, the following may be implemented: the modules can be located in the same processor; alternatively, the modules may be located in different processors in any combination.
It should be noted that the first communication module 40, the first determining module 42, the first configuring module 44 and the second communication module 46 correspond to steps S102 to S108 in embodiment 1, and the modules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in embodiment 1. It should be noted that the modules described above may be implemented in a computer terminal as part of an apparatus.
It should be noted that, reference may be made to the relevant description in embodiment 1 for alternative or preferred embodiments of this embodiment, and details are not described here again.
The server access device may further include a processor and a memory, where the first communication module 40, the first determining module 42, the first configuring module 44, the second communication module 46, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls a corresponding program unit from the memory, wherein one or more than one kernel can be arranged. The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
According to the embodiment of the application, the embodiment of the storage medium is also provided. Optionally, in this embodiment, the storage medium includes a stored program, and the device on which the storage medium is located is controlled to execute the any one of the server access methods when the program runs.
Optionally, in this embodiment, the storage medium may be located in any one of a group of computer terminals in a computer network, or in any one of a group of mobile terminals, and the storage medium includes a stored program.
Optionally, the program controls the device on which the storage medium is located to perform the following functions when running: receiving a first hypertext transfer protocol (HTTP) request; determining whether a first HOST field of the first HTTP request is configured with a first string, wherein the first string is used to identify the content of the first HOST field; configuring a second string for a second HOST field of a second HTTP request if the first string is configured in the first HOST field, wherein the second string is used to identify the content of the second HOST field; and transmitting the second HTTP request to an IPv4 server after the second string is configured for the second HOST field.
According to the embodiment of the application, the embodiment of the processor is also provided. Optionally, in this embodiment, the processor is configured to execute a program, where the program executes any one of the server access methods.
The embodiment of the application provides equipment, the equipment comprises a processor, a memory and a program which is stored on the memory and can run on the processor, and the following steps are realized when the processor executes the program: receiving a first hypertext transfer protocol (HTTP) request; determining whether a first HOST field of the first HTTP request is configured with a first string, wherein the first string is used to identify the content of the first HOST field; configuring a second string for a second HOST field of a second HTTP request if the first string is configured in the first HOST field, wherein the second string is used to identify the content of the second HOST field; and transmitting the second HTTP request to an IPv4 server after the second string is configured for the second HOST field.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: receiving a first hypertext transfer protocol (HTTP) request; determining whether a first HOST field of the first HTTP request is configured with a first string, wherein the first string is used to identify the content of the first HOST field; configuring a second string for a second HOST field of a second HTTP request if the first string is configured in the first HOST field, wherein the second string is used to identify the content of the second HOST field; and transmitting the second HTTP request to an IPv4 server after the second string is configured for the second HOST field.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or may be 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, units or modules, and may be in an electrical 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 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 may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. 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 above methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (12)

1. A server access method, comprising:
receiving a first hypertext transfer protocol (HTTP) request;
judging whether a first HOST field of the first HTTP request is configured with a first character string, wherein the first character string is used for identifying the content of the first HOST field;
if the first HOST field is configured with the first character string, configuring a second character string for a second HOST field of a second HTTP request, wherein the second character string is used for identifying the content of the second HOST field;
after configuring the second string for the second HOST field, sending the second HTTP request to an IPv4 server.
2. The method of claim 1,
configuring a second string for a second HOST field of the second HTTP request, comprising: and changing the domain name character string in the second HOST field into the second character string.
3. The method of claim 1, wherein prior to sending the second HTTP request to an IPv4 server, the method further comprises:
judging whether a first REFERER field of the first HTTP request is configured with the first character string, wherein the first character string is also used for identifying the content of the first REFERER field;
and if the REFERER field is configured with the first character string, configuring the second character string for a second REFERER field of a second HTTP request, wherein the second character string is also used for identifying the content of the second REFERER field.
4. The method of claim 1, wherein after sending the second HTT P request to an IPv4 server, the method further comprises:
detecting whether a first HTTP response returned by the IPv4 server is received;
under the condition that the first HTTP response is received, judging whether a first webpage address field of the first HTTP response is configured with the second character string or not;
if the first webpage address field is configured with the second character string, configuring the first character string for a second webpage address field of a second HTTP response;
and after the first character string is configured for the second webpage address field, sending the second HTTP response to the IPv6 client.
5. The method of claim 4,
prior to configuring the first string for a second web page address field of a second HTTP response, the method further comprises: detecting whether the first HOST field is configured with the first string; if the first HOST field is configured with the first character string, executing the step of configuring the first character string for a second webpage address field of a second HTTP response;
configuring the first string for a second web page address field of a second HTTP response, comprising: and changing the domain name character string in the second webpage address field into the first character string.
6. The method according to any one of claims 1 to 5, wherein the first HTTP request is an HTTP request sent by an IPv6 client to a proxy server, and the second HTTP request is an HTTP request sent by the proxy server to the IPv4 server.
7. A server access apparatus, comprising:
the first communication module is used for receiving a first hypertext transfer protocol (HTTP) request;
a first determining module, configured to determine whether a first HOST field of the first HTTP request is configured with a first character string, where the first character string is used to identify content of the first HOST field;
a first configuration module, configured to configure a second string for a second HOST field of a second HTTP request if the first HOST field is configured with the first string, wherein the second string is used to identify content of the second HOST field;
and the second communication module is used for sending the second HTTP request to an IPv4 server after the second character string is configured for the second HOST field.
8. The apparatus of claim 7, further comprising:
the first detection module is used for detecting whether a first HTTP response returned by the IPv4 server is received or not;
the second judging module is used for judging whether a first webpage address field of the first HTTP response is configured with a second character string or not under the condition of receiving the first HTTP response;
a second configuration module, configured to configure the first character string for a second webpage address field of a second HTTP response if the first webpage address field is configured with the second character string;
and the third communication module is used for sending the second HTTP response to the IPv6 client after the first character string is configured for the second webpage address field.
9. The apparatus of claim 8,
the device further comprises: a second detection module, configured to detect whether the first HOST field is configured with the first string; if the first HOST field is configured with the first character string, executing the second configuration module;
the second configuration module is further configured to change the domain name character string in the second web page address field to the first character string.
10. The apparatus of claim 7, further comprising:
a third determining module, configured to determine whether a first referr field of the first HTTP request is configured with the first character string, where the first character string is further used to identify content of the first referr field;
a third configuration module, configured to configure the second string for a second referr field of a second HTTP request if the referr field is configured with the first string, where the second string is further used to identify content of the second referr field.
11. A storage medium comprising a stored program, wherein a device on which the storage medium is located is controlled to perform the server access method according to any one of claims 1 to 6 when the program is executed.
12. A processor, configured to run a program, wherein the program when running performs the server access method of any one of claims 1 to 6.
CN201911340085.7A 2019-12-23 2019-12-23 Server access method and device Active CN111225038B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911340085.7A CN111225038B (en) 2019-12-23 2019-12-23 Server access method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911340085.7A CN111225038B (en) 2019-12-23 2019-12-23 Server access method and device

Publications (2)

Publication Number Publication Date
CN111225038A true CN111225038A (en) 2020-06-02
CN111225038B CN111225038B (en) 2023-04-18

Family

ID=70829561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911340085.7A Active CN111225038B (en) 2019-12-23 2019-12-23 Server access method and device

Country Status (1)

Country Link
CN (1) CN111225038B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187935A (en) * 2020-09-30 2021-01-05 杭州迪普科技股份有限公司 Information identification method and read-only memory
CN114710314A (en) * 2022-02-21 2022-07-05 深圳腾银信息咨询有限责任公司 Configured software service platform access method, device, system and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662411A (en) * 2008-08-26 2010-03-03 杭州华三通信技术有限公司 Method and device for IPv4 host computer to access IPv6 network server
CN102299931A (en) * 2011-09-19 2011-12-28 莫雅静 Webpage content sending method and agent server
CN103428303A (en) * 2012-05-22 2013-12-04 中兴通讯股份有限公司 Method and system for IPv6 host to have access to IPv4 server
CN110225150A (en) * 2019-06-27 2019-09-10 中星科源(北京)信息技术有限公司 Communication means, system and storage medium between different network protocol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662411A (en) * 2008-08-26 2010-03-03 杭州华三通信技术有限公司 Method and device for IPv4 host computer to access IPv6 network server
CN102299931A (en) * 2011-09-19 2011-12-28 莫雅静 Webpage content sending method and agent server
CN103428303A (en) * 2012-05-22 2013-12-04 中兴通讯股份有限公司 Method and system for IPv6 host to have access to IPv4 server
CN110225150A (en) * 2019-06-27 2019-09-10 中星科源(北京)信息技术有限公司 Communication means, system and storage medium between different network protocol

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187935A (en) * 2020-09-30 2021-01-05 杭州迪普科技股份有限公司 Information identification method and read-only memory
CN112187935B (en) * 2020-09-30 2023-02-07 杭州迪普科技股份有限公司 Information identification method and read-only memory
CN114710314A (en) * 2022-02-21 2022-07-05 深圳腾银信息咨询有限责任公司 Configured software service platform access method, device, system and medium

Also Published As

Publication number Publication date
CN111225038B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
CN108737327B (en) Method, device and system for intercepting malicious website and memory
US8533328B2 (en) Method and system of determining vulnerability of web application
CN109543121B (en) Method and device for calling outer link url (real time communication) resources
CN103607385B (en) Method and apparatus for security detection based on browser
CN108809890B (en) Vulnerability detection method, test server and client
CN106936791B (en) Method and device for intercepting malicious website access
CN105430011A (en) Method and device for detecting distributed denial of service attack
CN108259425A (en) The determining method, apparatus and server of query-attack
CN101808018B (en) Method and device for detecting quantity of access terminals
CN106453216A (en) Malicious website interception method, malicious website interception device and client
CN110248364B (en) IOT equipment network distribution method, device, equipment and medium
CN104468531A (en) Authorization method, device and system for sensitive data
CN107124430B (en) Page hijacking monitoring method, device, system and storage medium
CN107347076B (en) SSRF vulnerability detection method and device
CN107016074B (en) Webpage loading method and device
CN102884764A (en) Message receiving method, deep packet inspection device, and system
CN108063833B (en) HTTP DNS analysis message processing method and device
CN109617917A (en) Address virtual Web application security firewall methods, devices and systems
CN110557358A (en) Honeypot server communication method, SSLStrip man-in-the-middle attack perception method and related device
KR101996471B1 (en) Network Securing Device and Securing method Using The Same
CN111225038B (en) Server access method and device
EP3376740B1 (en) Method and apparatus for acquiring ip address
CN110879891A (en) Vulnerability detection method and device based on web fingerprint information
CN108737407A (en) A kind of method and device for kidnapping network flow
CN113873057B (en) Data processing method and device

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