CN115080883A - Application resource proxy method and device and electronic equipment - Google Patents

Application resource proxy method and device and electronic equipment Download PDF

Info

Publication number
CN115080883A
CN115080883A CN202110266892.XA CN202110266892A CN115080883A CN 115080883 A CN115080883 A CN 115080883A CN 202110266892 A CN202110266892 A CN 202110266892A CN 115080883 A CN115080883 A CN 115080883A
Authority
CN
China
Prior art keywords
domain name
application
proxy
url
resource
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.)
Pending
Application number
CN202110266892.XA
Other languages
Chinese (zh)
Inventor
杨晨
许庆贤
何林江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110266892.XA priority Critical patent/CN115080883A/en
Publication of CN115080883A publication Critical patent/CN115080883A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities

Abstract

The application provides a proxy method and device of application resources, electronic equipment and a computer readable storage medium; relates to network technology in the cloud technology field; the method comprises the following steps: binding a plurality of application environments with the same agent domain name; receiving an access request of a Uniform Resource Locator (URL) including a proxy domain name; determining a target application environment requested by an access request in a plurality of application environments with binding relation with a proxy domain name; and updating the URL of the application resource in the target application environment according to the proxy domain name, and responding to the access request according to the application resource comprising the updated URL. According to the method and the device, a plurality of application environments can be proxied through the unified proxy domain name, the flexibility and the convenience of accessing application resources in different application environments are improved based on a domain name resolution mode, and meanwhile the waste of computing resources of the electronic equipment can be reduced.

Description

Application resource proxy method and device and electronic equipment
Technical Field
The present application relates to network technologies, and in particular, to a method and an apparatus for proxying an application resource, an electronic device, and a computer-readable storage medium.
Background
An Application (Application) refers to an Application program written in a programming language for implementing a specific function, and may include, for example, a system Application of an electronic device and a user Application designed specifically for an individual. The application usually involves multiple links such as development, test, and product experience, and therefore, multiple application environments are often configured to support corresponding operations such as development, test, and experience.
In the solutions provided in the related art, different Uniform Resource Locators (URLs) are generally configured for different application environments, so that the URLs need to be frequently switched when accessing application resources in different application environments, which is poor in flexibility and also easily wastes computing resources of the electronic device.
Disclosure of Invention
The embodiment of the application resource proxy method and device, the electronic device and the computer readable storage medium can improve flexibility and convenience of accessing application resources and reduce waste of computing resources of the electronic device.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a proxy method for application resources, which comprises the following steps:
binding a plurality of application environments with the same agent domain name;
receiving an access request of a Uniform Resource Locator (URL) including the proxy domain name;
determining a target application environment requested by the access request in the plurality of application environments having binding relation with the proxy domain name;
and updating the URL of the application resource in the target application environment according to the proxy domain name, and responding to the access request according to the application resource comprising the updated URL.
In the above solution, the determining, in the plurality of application environments having a binding relationship with the proxy domain name, a target application environment requested by the access request includes:
obtaining access identity information in the access request, and verifying the access identity information to obtain an identity information verification result;
when the identity information verification result is verification success, determining an accessible application environment according to the access identity information in the plurality of application environments in the binding relationship with the proxy domain name;
wherein each of the application environments corresponds to at least one accessible identity information;
in at least one of the accessible application environments, a target application environment requested by the access request is determined.
In the foregoing solution, the responding to the access request according to the application resource including the updated URL includes:
and responding to the access request according to the application resource which comprises the updated URL in the target application environment and the application resource which does not comprise the URL.
An embodiment of the present application provides an agent apparatus for applying resources, including:
the binding module is used for binding a plurality of application environments with the same agent domain name;
a receiving module, configured to receive an access request including the proxy domain name from a uniform resource locator URL;
the environment determining module is used for determining a target application environment requested by the access request in the plurality of application environments with the binding relation with the proxy domain name;
and the updating module is used for updating the URL of the application resource in the target application environment according to the proxy domain name and responding to the access request according to the application resource comprising the updated URL.
In the foregoing solution, the environment determining module is further configured to:
obtaining access identity information in the access request, and verifying the access identity information to obtain an identity information verification result;
when the identity information verification result is that the verification is successful, determining an application environment which can be accessed according to the access identity information in the plurality of application environments which have binding relations with the agent domain name;
wherein each of the application environments corresponds to at least one accessible identity information;
in at least one of the accessible application environments, a target application environment requested by the access request is determined.
In the foregoing solution, the update module is further configured to:
and responding to the access request according to the application resource which comprises the updated URL in the target application environment and the application resource which does not comprise the URL.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the proxy method of the application resource provided by the embodiment of the application when the executable instruction stored in the memory is executed.
An embodiment of the present application provides a computer-readable storage medium, which stores executable instructions for causing a processor to implement the proxy method for application resources provided in the embodiment of the present application when executed.
The embodiment of the application has the following beneficial effects:
binding a plurality of application environments with the same proxy domain name, and determining a target application environment requested by an access request in the bound plurality of application environments when the access request of a Uniform Resource Locator (URL) including the proxy domain name is received, so that access to the plurality of application environments can be realized according to the uniform proxy domain name without frequently switching the URL; in addition, the URL of the application resource in the target application environment is updated according to the proxy domain name so as to respond to the access request, and effective proxy of the application resource can be realized. In summary, the embodiment of the application can improve the flexibility and convenience of accessing application resources in different application environments based on the proxy domain name, and can reduce the waste of computing resources of the electronic device.
Drawings
FIG. 1 is a schematic diagram of an architecture of a proxy system for applying resources according to an embodiment of the present application;
fig. 2 is a schematic architecture diagram of a terminal device provided in an embodiment of the present application;
fig. 3A to fig. 3E are schematic flow charts of a proxy method for applying resources according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a user interface of a client provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a domain name application interface provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a space application interface provided by an embodiment of the present application;
FIG. 7 is a diagram of a domain name binding interface provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of an environment creation interface provided by an embodiment of the present application;
FIG. 9 is a schematic illustration of an environment management interface provided by an embodiment of the application;
FIG. 10 is a schematic diagram of an agent rule management interface provided by an embodiment of the application;
FIG. 11 is a schematic diagram of a browser interface of a client provided by an embodiment of the present application;
fig. 12 is a flowchart illustrating a proxy method for applying a resource according to an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. In the following description, the term "plurality" referred to means at least two.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) The application comprises the following steps: refers to application programs that are programmed in a programming language for implementing specific functions, for example, the applications may include system applications of the electronic device (e.g., applications for implementing underlying functions of the electronic device) and user applications specifically designed for an individual (e.g., Web applications).
2) Application resources: refers to a static resource in an application. The embodiment of the present application does not limit the type of the application resource, and taking a Web application as an example, the type of the application resource may include a hypertext Markup Language (HTML) resource, a Cascading Style Sheets (CSSs) resource, and a JavaScript resource.
3) The application environment is as follows: pointers refer to the general term of computer hardware, software, network devices, and data deployed by an application, which the application environment may support performing specific operations on the application. For example, the application environment may include a development environment (for supporting developers to develop applications), a test environment (for supporting testers to test whether applications are stable, whether BUGs exist, etc.), and a production environment (for supporting users to use applications daily).
4) Uniform Resource Locator (URL): a representation of the location of information (e.g., application resources) in a network. The URL mainly includes two parts, a domain name and a resource path, wherein the domain name is a name of a computer (i.e., an electronic device) or a group of computers in a network composed of a string of characters separated by dots, and is used to identify an electronic position of the computer during data transmission; a resource path refers to a path of an application resource among a computer or group of computers represented by a domain name. For example, the URL may be new.xx.com/demo.html, where new.xx.com is a domain name and demo.html is a resource path.
It should be noted that the URL may also include other content, which is not limited to this, and may also include a specified transmission Protocol, such as HyperText Transfer Protocol (HTTP), for example.
5) Domain name delimiters: the separators used to separate the content in different meanings (hierarchies) in the URL, the default domain name separator in the URL is slash "/", and in the embodiment of the present application, a special domain name separator such as "_ tde _" may be used.
The embodiment of the application resource proxy method and device, the electronic device and the computer readable storage medium can improve flexibility and convenience of accessing application resources and reduce waste of computing resources of the electronic device. An exemplary application of the electronic device provided in the embodiment of the present application is described below, and the electronic device provided in the embodiment of the present application may be implemented as various types of terminal devices, and may also be implemented as a server.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a proxy system 100 for application resources according to an embodiment of the present application, in which a terminal device 400 is connected to a server 200 through a network 300-1, and the server 200 is connected to a server 500-1 and a server 500-2 through a network 300-2. The server 500-1 and the server 500-2 respectively provide one application environment, and the application environment a and the application environment B are distinguished in fig. 1, but this does not constitute a limitation to the embodiment of the present application, for example, one server may provide multiple application environments, for example, one application environment may be provided by multiple servers (e.g., a server cluster). In addition, the network 300-1 may be a wide area network or a local area network, or a combination of both, and the network 300-2 is similar.
In some embodiments, taking the electronic device as a terminal device as an example, the proxy method for application resources provided in the embodiments of the present application may be implemented by the terminal device. For example, the terminal device 400 runs a client 410 and a proxy client, wherein the client 410 corresponds to an application to be proxied, such as a Web application; the proxy client is used for realizing proxy functions. The agent client binds a plurality of application environments of the application to be proxied with the same agent domain name, wherein the relevant information of the application environments and the agent domain name can be obtained by the agent client from the outside, for example, the agent client can present a user interface and receive the relevant information of the application environments and the agent domain name input by a user in the user interface.
After the binding process is completed, the proxy client intercepts an access request of which the URL sent by the client 410 includes a proxy domain name, and determines a target application environment requested by the access request in a plurality of application environments having a binding relationship with the proxy domain name when the access request is intercepted. Then, the proxy client acquires the application resource in the target application environment, and updates the URL in the acquired application resource according to the proxy domain name to obtain an updated URL. Taking the target application environment as the application environment a provided by the server 500-1 as an example, the proxy client may obtain the application resource from the server 500-1, wherein a direct or indirect connection may exist between the proxy client and the server 500-1. Finally, the proxy client sends the application resource including the updated URL to the client 410 as a response to the access request. As an example, a user interface provided by the client 410, that is, a user interface of an xx application program, is shown in fig. 1, and an application resource obtained after the client 410 sends an access request is presented in the user interface, and an image resource is taken as an example in fig. 1, and the image resource includes an updated URL (not shown in fig. 1).
In some embodiments, taking the electronic device as a server as an example, the proxy method for application resources provided in the embodiments of the present application may also be implemented by the server. For example, the server 200 may be a server for implementing a proxy function, and in the process of implementing the proxy function, the server 200 first performs a binding process on a plurality of application environments and the same proxy domain name. After the binding process is completed, the server 200 may intercept an access request sent by the client 410, where the URL includes a proxy domain name. When an access request is intercepted, the server 200 determines a target application environment requested by the access request among a plurality of application environments having a binding relationship with the proxy domain name, taking an application environment a provided by the target application environment as the server 500-1 in fig. 1 as an example. Then, the server 200 acquires the application resource from the target application environment, updates the URL of the acquired application resource according to the proxy domain name, and sends the application resource including the updated URL to the client 410 as a response to the intercepted access request.
It should be noted that the server 200 shown in fig. 1 is merely an example, and actually, the proxy function may be implemented by a terminal device different from the terminal device 400.
In some embodiments, the terminal device 400 or the server 200 may implement the proxy method of the application resource provided by the embodiments of the present application by running a computer program, for example, the computer program may be a native program or a software module in an operating system; can be a local (Native) Application program (APP), i.e. a program that needs to be installed in an operating system to run; or may be an applet, i.e. a program that can be run only by downloading it to the browser environment; but also an applet that can be embedded into any APP. In general, the computer programs described above may be any form of application, module or plug-in.
In some embodiments, the servers (e.g., the server 200, the server 500-1, and the server 500-2) shown above may be independent physical servers, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, Network services, cloud communication, middleware services, domain name services, security services, Network acceleration services (CDN), and big data and artificial intelligence platforms, where the cloud services may be cloud proxy services for the terminal device 400 to call. It should be noted that Cloud Technology (Cloud Technology) refers to a hosting Technology for unifying a series of resources such as hardware, software, and network in a wide area network or a local area network to realize calculation, storage, processing, and sharing of data. In addition, the terminal device 400 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart television, a smart watch, and the like, but is not limited thereto. The terminal device and the server may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited.
Taking the electronic device provided in the embodiment of the present application as an example for illustration, it can be understood that, for the case where the electronic device is a server, parts (such as the user interface, the presentation module, and the input processing module) in the structure shown in fig. 2 may be default. Referring to fig. 2, fig. 2 is a schematic structural diagram of a terminal device 400 provided in an embodiment of the present application, where the terminal device 400 shown in fig. 2 includes: at least one processor 410, memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal device 400 are coupled together by a bus system 440. It is understood that the bus system 440 is used to enable communications among the components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 440 in FIG. 2.
The Processor 410 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 430 includes one or more output devices 431, including one or more speakers and/or one or more visual displays, that enable the presentation of media content. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 450 optionally includes one or more storage devices physically located remote from processor 410.
The memory 450 includes either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The memory 450 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data, examples of which include programs, modules, and data structures, or a subset or superset thereof, to support various operations, as exemplified below.
An operating system 451, including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
a network communication module 452 for communicating to other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
a presentation module 453 for enabling presentation of information (e.g., user interfaces for operating peripherals and displaying content and information) via one or more output devices 431 (e.g., display screens, speakers, etc.) associated with user interface 430;
an input processing module 454 for detecting one or more user inputs or interactions from one of the one or more input devices 432 and translating the detected inputs or interactions.
In some embodiments, the apparatus provided in this embodiment may be implemented in software, and fig. 2 illustrates an agent apparatus 455 of an application resource stored in a memory 450, which may be software in the form of programs and plug-ins, and includes the following software modules: a binding module 4551, a receiving module 4552, an environment determination module 4553 and an updating module 4554, which are logical and thus arbitrarily combined or further divided according to the functions implemented. The functions of the respective modules will be explained below.
The proxy method for application resources provided by the embodiments of the present application will be described in conjunction with exemplary applications and implementations of electronic devices provided by the embodiments of the present application. For ease of understanding, the electronic device for implementing the agent function is named an agent device.
Referring to fig. 3A, fig. 3A is a flowchart illustrating a proxy method for applying resources according to an embodiment of the present application, and will be described with reference to the steps shown in fig. 3A.
In step 101, a plurality of application environments and the same proxy domain name are bound.
For an application, multiple links such as development, testing, and product experience are often involved, so that multiple application environments are often configured to support corresponding operations such as development, testing, and experience. The type of the application environment is not limited in the embodiment of the application, for example, the application environment may be any one of a test environment, a development environment and a production environment; the form of the proxy domain name is not limited, and can be set according to the actual application scene.
In step 102, an access request is received in which a uniform resource locator, URL, includes a proxy domain name.
The binding process executed in step 101 is to establish a binding relationship between multiple application environments and a proxy domain name, and based on the binding relationship, the proxy device may intercept, in a network, an access request including the proxy domain name from a URL sent by a client, where the network may be a wide area network or a local area network, or a combination of the two. The type of the access request is not limited in the embodiments of the present application, and the access request may be, for example, an HTTP request, depending on a protocol in a URL included in the access request.
In step 103, a target application environment requested by the access request is determined among the plurality of application environments having binding relationships with the proxy domain name.
When the agent device intercepts (receives) the access request, the target application environment requested by the access request is determined in a plurality of application environments with binding relation with the agent domain name, wherein the number of the target application environments is one. The method for determining the target application environment is not limited in the embodiment of the present application, and for example, the method may randomly select from a plurality of application environments having a binding relationship with the proxy domain name, and use a selected application environment as the target application environment. Of course, the target application environment may also be specified by the access request.
In some embodiments, the above-mentioned determining the target application environment requested by the access request in the plurality of application environments having the binding relationship with the proxy domain name may be implemented in such a manner that: obtaining access identity information in the access request, and verifying the access identity information to obtain an identity information verification result; when the identity information verification result is that the verification is successful, determining an application environment accessible according to the access identity information in a plurality of application environments in binding relationship with the proxy domain name; wherein each application environment corresponds to at least one accessible identity information; in at least one accessible application environment, a target application environment requested by an access request is determined.
When the access request includes identity information (for convenience of distinction, named as access identity information), the agent device may perform authentication processing on the access identity information to obtain an identity information authentication result. The access identity information may be in the form of, for example, a user name + a password, or in the form of a Cookie, where the Cookie is data stored in the client for identifying the user identity. The agent device can match the access identity information with a plurality of pieces of pre-stored safety identity information, and when the access identity information is successfully matched with any one piece of safety identity information, the identity information verification result is determined to be successful, wherein the successful matching can mean the same; when the access identity information and all the security identity information are unsuccessfully matched, the identity information verification result is determined to be verification failure, and the matching failure can be different.
And when the identity information verification result is that the verification is successful, the proxy equipment determines the accessible application environment for accessing the identity information in a plurality of application environments in binding relationship with the proxy domain name. For example, a plurality of application environments may be traversed, and when a whitelist corresponding to the traversed application environment includes the access identity information, the traversed application environment is used as an application environment accessible according to the access identity information; and when the white list corresponding to the traversed application environment does not comprise the access identity information, taking the traversed application environment as the inaccessible application environment according to the access identity information. And the white list corresponding to each application environment comprises at least one piece of accessible identity information. In addition, when the identity information verification result is that the verification fails, the proxy device may send an insecurity-of-identity prompt to the client, so as to prompt the client to initiate an access request according to the new access identity information.
When the number of the accessible application environments is at least one, the proxy device determines the target application environment requested by the access request among all the accessible application environments, for example, the target application environment may be obtained by randomly selecting among all the accessible application environments, or a default application environment among all the accessible application environments may be used as the target application environment, which is not limited in this manner. Further, when the number of accessible application environments is zero, the proxy device may send a prompt for unauthorized access to the client.
By the mode, on one hand, the access identity information is verified, and the security control can be performed on the access identity information; on the other hand, the accessible application environment is screened out according to the access identity information, and the safety of application resources in the application environment can be ensured. It should be noted that the operation of performing the verification process on the access identification information and the operation of determining the accessible application environment may be performed only by selecting one of them.
In step 104, the URL of the application resource in the target application environment is updated according to the proxy domain name, and the access request is responded according to the application resource including the updated URL.
Here, the proxy device acquires an application resource in the target application environment, and updates the URL of the acquired application resource according to the proxy domain name to obtain an updated URL. The obtained application resource may be a full amount of application resource or a part of application resource in the target application environment, and is determined according to the URL in the access request.
It should be noted that, here, the update processing is performed on the URL included in the application resource, and for example, the URL included in the HTML resource may be the URL specified by the href attribute of the HTML resource in the case that the application resource is the HTML resource. In addition, the updated URL obtained after the update processing at least includes the proxy domain name.
Then, the proxy device responds to the access request according to the application resource including the updated URL, for example, transmits the application resource of the updated URL to the client as a response to the access request transmitted by the client. In this manner, the client can enable access to application resources in multiple application environments based on a unified proxy domain name without modifying the proxy domain name included in the URL in the access request for different application environments.
When receiving the application resource, the client can generate and send a new access request according to the updated URL in the application resource, so that the proxy domain name-based access is realized again. For example, the client may present the received application resource in the user interface, and upon receiving a trigger operation for the application resource, generate a new access request according to the updated URL in the triggered application resource. It should be noted that, when processing a new access request received from the client, the proxy device may directly use the target application environment determined in step 103, that is, may not re-determine the target application environment.
For ease of understanding, the embodiment of the present application provides a schematic user interface diagram of a client as shown in fig. 4, so that the proxied application is an example of a live application. First, the client generates an access request according to a URL obtained in an address field 42 of a user interface 41 (such as a browser interface), where the URL includes at least a proxy domain name, and sends the access request to the network, where "proxy domain name/… …" is taken as an example in fig. 4. When receiving the application resource to which the proxy device responds to the access request, the client presents the application resource in the user interface 41, such as the text of the "live application", the image of the anchor a, the image of the anchor B, and the image of the anchor C in fig. 4, where the updated URL in the application resource may not be presented.
When receiving a trigger operation for any one of the presented application resources, the client generates a new access request according to the updated URL in the triggered application resource, and sends the new access request to the network, where the triggered application resource is taken as an example of the application resource 43. When receiving the application resource 44 responded by the proxy device to the new access request, the client presents the application resource 44 in the user interface 41, which is illustrated in fig. 4 by the application resource 44 as live room data of the C anchor.
In some embodiments, when the URL of the application resource in the target application environment is updated according to the proxy domain name, the method further includes: deleting at least one of the following attributes included in the application resource: a prohibited update attribute, a prohibited identity attribute, a prohibited proxy attribute, a content encoding attribute, and a content length attribute.
Here, the attributes that can be deleted from the application resource will be described separately.
1) The update prohibition attribute is used for prohibiting (or called blocking) the content of the application resource from being updated, so that the update prohibition attribute can be deleted to ensure that the update processing on the URL of the application resource can be successfully completed. Updating attributes such as the integer attribute in the script tag of the HTML resource is prohibited.
2) The identity prohibiting attribute is used for prohibiting the client from carrying the access identity information in the access request initiated based on the application resource, so that the identity prohibiting attribute can be deleted to improve the security of subsequent access. Identity attributes such as crosssort attribute in script tag of HTML resource are prohibited.
3) And the proxy attribute is forbidden, and is used for limiting the loading source of the application resource, namely limiting the client to only load the application resource of the same source and not to load the application resource proxied by the proxy equipment. Therefore, the prohibited proxy attribute may be deleted to ensure that the client can successfully load the application resource sent by the proxy device. A proxy attribute such as the content-security-policy attribute is disabled.
4) A content encoding attribute for representing compression encoding of the application resource. The proxy device decompresses and then compresses again in the process of proxying the application resource, so that the actual compression code of the application resource is inconsistent with the compression code in the content coding attribute, and further the client fails to load the application resource. Therefore, the content encoding attribute can be deleted to ensure that the client can successfully load the application resource sent by the proxy device. Content-encoding attributes such as content-encoding attributes.
5) And the content length attribute is used for indicating the content length of the application resource. Since the proxy device performs update processing on the URL of the application resource, the actual content length of the application resource after the update processing is inconsistent with the content length in the content length attribute, and further the client fails to load the application resource. Therefore, the content length attribute can be deleted to ensure that the client can successfully load the application resource sent by the proxy device. A content-length attribute such as a content-length attribute.
In some embodiments, the above responding to the access request according to the application resource including the updated URL may be implemented in such a manner that: and responding to the access request according to the application resource including the updated URL and the application resource not including the URL in the target application environment.
For the application resources acquired by the proxy device from the target application environment, part of the application resources may include URLs, and part of the application resources does not include URLs, so that the proxy device may filter the application resources including the URLs from the acquired application resources, and update the URLs of the filtered application resources. Further, the application resources not including the URL among the acquired application resources may be left as they are. In this way, when the proxy device responds to the access request, two resources are mainly fed back, the first resource is an application resource which is acquired from the target application environment and has the updated URL, and the second resource is an application resource which is acquired from the target application environment and does not include the URL. By the method, comprehensiveness and accuracy of responding to the access request can be improved.
In some embodiments, before step 104, further comprising: and acquiring the application resource with the format of stream data from the target application environment, and converting the format of the application resource from the stream data into character string data.
In some cases, such as node.js scenario, where the proxy device acquires an application resource in a streaming (i.e., Stream) data format from a target application environment, since streaming data is not convenient to directly process, the format of the application resource can be converted from streaming data into String (String) data, where node.js is a JavaScript running environment constructed based on Chrome V8 engine, and is a backend technology. For example, the format of the application resource may be converted from stream data to binary data (e.g., binary data processed using a Buffer class), and then the format of the application resource may be converted from binary data to string data. Compared with stream data, the character string data is easier to process, so that the convenience of updating the URL can be improved by the mode.
As shown in fig. 3A, the embodiment of the present application provides a way of accessing multiple application environments according to a unified proxy domain name, which can improve flexibility and convenience of access, and can also reduce waste of computing resources.
In some embodiments, referring to fig. 3B, fig. 3B is a flowchart illustrating a proxy method for applying a resource according to an embodiment of the present application, and step 104 shown in fig. 3A may be implemented by steps 201 to 204, which will be described in conjunction with the steps.
In step 201, the content to be proxied including the domain name corresponding to the target application environment is obtained.
Aiming at a plurality of application environments with binding relation with the proxy domain name, the proxy equipment acquires a proxy rule configured for each application environment. For example, the agent device may present an agent rule configuration interface and obtain agent rules configured for the application environment in response to configuration operations received in the agent rule configuration interface. In the embodiment of the present application, the proxy rule may be embodied in the form of content to be proxied, where the content to be proxied includes at least a domain name, and may also include part or all of the resource path.
In step 202, the URL of the application resource in the target application environment is matched with the content to be proxied, so as to obtain a matching result.
Here, for each application resource (here, an application resource including a URL) acquired by the proxy device from the target application environment, matching the URL of the application resource with the content to be proxied corresponding to the target application environment, and when the URL of the application resource includes the content to be proxied corresponding to the target application environment, determining that the matching result is a successful matching; and when the URL of the application resource does not comprise the content to be proxied corresponding to the target application environment, determining that the matching result is matching failure.
In some embodiments, the number of the contents to be proxied corresponding to the target application environment includes a plurality of contents, and each content to be proxied corresponds to a priority; the above-mentioned matching process of the URL of the application resource in the target application environment and the content to be proxied can be implemented in this way: traversing the plurality of contents to be proxied according to the corresponding priority order of the plurality of contents to be proxied, and executing the following processing aiming at the traversed contents to be proxied: and matching the URL of the application resource in the target application environment with the traversed content to be proxied.
Here, when the number of the contents to be proxied corresponding to the target application environment includes a plurality of contents, and each of the contents to be proxied corresponds to one priority, the plurality of contents to be proxied corresponding to the target application environment may be sorted according to the priority corresponding to each of the contents to be proxied, where the sorting is performed in an order of priority from high to low.
Then, for each application resource (here, the application resource including the URL) acquired by the proxy device from the target application environment, traversing the sequenced plurality of contents to be proxied, and matching the URL of the application resource with the traversed contents to be proxied. When the obtained matching result is that the matching is successful, executing step 203 for the application resource; and when the obtained matching result is matching failure, continuously traversing the next content to be proxied. The higher the priority corresponding to the content to be proxied is, the higher the importance degree of the content is, so that the accuracy of the matching processing and the subsequent updating processing can be improved by the mode. It should be noted that, when the URL of an application resource fails to match all the contents to be proxied corresponding to the target application environment, the application resource may be ignored, that is, the URL of the application resource is not updated.
In step 203, when the matching result is that the matching is successful, the proxy domain name is added to the URL of the application resource, and the proxy domain name, the content to be proxied, and the remaining content in the URL of the application resource are separated according to the domain name separator, so as to obtain an updated URL.
The embodiment of the present application provides an example of performing update processing on a URL of an application resource, and when a matching result is that matching is successful, the proxy device may add a proxy domain name to the URL of the application resource, for example, to a header of the URL. And then, separating the proxy domain name, the content to be proxied and the residual content in the URL of the application resource according to the domain name separator to obtain the updated URL. The domain name separator may be a default domain name separator "/" in the URL, or may be a special domain name separator, such as "_ tde _".
In some embodiments, before step 102, further comprising: binding the default domain name with the proxy domain name; when the content to be proxied includes a default domain name having a binding relationship with the proxy domain name and the matching result is that the matching is successful, the method further includes: and deleting the default domain name in the URL of the application resource so as to update the content to be proxied in the URL of the application resource.
In the embodiment of the application, besides the binding processing of the plurality of application environments and the proxy domain name, the proxy device may also bind the acquired default domain name and the proxy domain name, where the default domain name is different from the proxy domain name, and a specific form of the default domain name is not limited.
When the content to be proxied includes the default domain name and the matching result between the URL of the application resource and the content to be proxied is that the matching is successful, the default domain name (i.e., the original domain name) in the URL of the application resource does not need to be reserved, and the default domain name in the URL of the application resource is directly deleted to update the content to be proxied in the URL of the application resource. When the URL is subsequently restored, the proxy device may directly restore the default domain name having the binding relationship, because the updated URL only includes one domain name of the proxy domain name.
For example, if the URL of an application resource is now8.gtimg.com/test.js, the proxy domain name is fast. now.xx.com, the content to be proxied corresponding to the target application environment is now8.gtimg.com, and the default domain name is also now8.gtimg.com, the default domain name in the URL of the application resource may be deleted, and the proxy domain name may be added to the header of the URL, and then the proxy domain name in the URL, the updated content to be proxied (here, null), and the remaining content may be separated according to a domain name separator (for example, "_ tde _", so as to obtain the updated URL of fast. now.xx.com/_ tde _/test.js. When the domain name delimiter is "/" default in the URL, the obtained updated URL is fast.
It should be noted that, in the embodiment of the present application, the execution timing of the operation of deleting the default domain name is not limited, and for example, the operation may be performed after the proxy domain name is added to the URL of the application resource and before the partition processing is performed according to the domain name separator, or may be performed after the partition processing is performed according to the domain name separator.
In some embodiments, when the matching result is that the matching is successful, the method further includes: and aiming at the domain name included by the content to be proxied in the URL of the application resource, converting the domain name from a domain name format to a non-domain name format so as to update the content to be proxied in the URL of the application resource.
Here, when the matching result is that the matching is successful, the original domain name (i.e., the domain name included in the content to be proxied) in the URL of the application resource may be converted from the domain name format to the non-domain name format to update the content to be proxied in the URL of the application resource.
It is worth mentioning that the domain name format and the non-domain name format may be formats for delimiters inside the domain name, e.g. in the domain name format, delimiters inside the domain name are default "", such as the domain name now8.gtimg.com; in the non-domain name format, the separator inside the domain name is a special set internal separator "_", i.e. underline, and this, of course, does not constitute a limitation on the non-domain name format.
For ease of understanding, this is illustrated. The URL of an application resource is now8.gtimg.com/test.js, the proxy domain name is fast. now.xx.com, and the content to be proxied is now8.gtimg.com, the original domain name in the URL may be converted from the domain name format to the non-domain name format, and the proxy domain name is added to the header of the URL, and finally the proxy domain name in the URL, the updated content to be proxied (the updated original domain name), and the remaining content are separated according to a domain name separator (taking "_ tde _" as an example), so that the updated URL is fast. now.xx.com/_ tde _/now8_ gtimg _ com/_ tde _/test.js. When the domain name delimiter is the default "/" in the URL, the obtained updated URL is fast.
It should be noted that, in the embodiment of the present application, the execution timing of the operation of converting the original domain name from the domain name format to the non-domain name format is not limited, and for example, the operation may be performed after the proxy domain name is added to the URL of the application resource and before the partition processing is performed according to the domain name separator, or may be performed after the partition processing is performed according to the domain name separator.
In step 204, the access request is responded to according to the application resource that includes the updated URL.
As shown in fig. 3B, in the embodiment of the present application, the URL of the application resource is updated based on the content to be proxied corresponding to the target application environment, so that the effectiveness and accuracy of the update processing can be improved.
In some embodiments, referring to fig. 3C, fig. 3C is a schematic flowchart of a proxy method for applying resources provided in this embodiment, and after step 102 shown in fig. 3A, in step 301, a URL in an access request may be split according to a domain name delimiter, so as to obtain a proxy domain name and a restored URL.
For example, for a URL in the access request, the proxy device may use the content before the first domain name delimiter in the URL as a proxy domain name, and use the content after the first domain name delimiter in the URL as a restored URL. The domain name separator may be a default domain name separator "/" in the URL, or may be a special domain name separator, such as "_ tde _".
It is noted that step 301 may be performed before or after step 103, or may be performed simultaneously.
In fig. 3C, step 104 shown in fig. 3A can be implemented by steps 302 to 304, which will be described in conjunction with each step.
In step 302, query processing is performed in the target application environment according to the restored URL.
After determining the target application environment, the proxy device may perform query processing in the target application environment according to the restored URL.
It should be noted that, in the embodiment of the present application, data differences may exist between different application environments, and therefore, even for the same URL, application resources obtained by performing query processing in different application environments may also be different.
In some embodiments, the above-described query processing in the target application environment according to the restored URL may be implemented in such a manner that: splitting the reduced URL according to the domain name separator to obtain a candidate domain name and a candidate resource path; when the candidate domain name comprises the parameter identification, deleting the parameter identification in the candidate domain name and the parameter identified by the parameter identification, and adding the deleted parameter identification and the parameter into the candidate resource path; when the candidate domain name is successfully matched with the non-domain name format, converting the candidate domain name into the domain name format from the non-domain name format; and taking the candidate domain name as a reduced domain name, taking the candidate resource path as a reduced resource path, and performing query processing in a target application environment according to the reduced domain name and the reduced resource path.
In order to ensure the accuracy of query processing, the proxy device may further restore the restored URL to obtain the restored domain name and the restored resource path. In the process, the restored URL may be split according to the domain name separator to obtain a candidate domain name and a candidate resource path, for example, content in the restored URL before the first domain name separator may be used as the candidate domain name, and content in the restored URL after the first domain name separator may be used as the candidate resource path.
It should be noted that, if the domain name delimiter used for performing the splitting process on the restored URL is a special set domain name delimiter, the obtained candidate domain name may further include a default domain name delimiter. For this case, the candidate domain name may be split according to the default domain name delimiter, that is, the content of the candidate domain name after the first default domain name delimiter is added to the candidate resource path, for example, to the header of the candidate resource path, and the content of the candidate domain name before the first default domain name delimiter is used as the new candidate domain name.
When the candidate domain name includes the parameter identifier, it is proved that the parameter identified by the parameter identifier does not belong to the actual domain name, and therefore, the parameter identifier in the candidate domain name and the parameter identified by the parameter identifier are deleted, and the deleted parameter identifier and the deleted parameter are added to the candidate resource path, such as to the header of the candidate resource path. Wherein, the parameter identification is as "? "identify. For example, if the candidate domain name is now8_ gtimg _ com ═ 123, then delete? 123, and will? And adding the id 123 to the head of the candidate resource path to realize the update of the candidate resource path.
And when the candidate domain name is successfully matched with the non-domain name format, converting the candidate domain name from the non-domain name format to the domain name format. For example, if the candidate domain name is now8_ gtimg _ com, the set internal delimiter "_" (corresponding to the non-domain name format) in the candidate domain name is converted into the default internal delimiter "_" (corresponding to the domain name format), i.e., the candidate domain name is updated to be now8. gtimg.com.
And finally, taking the candidate domain name as a reduced domain name (namely an original domain name), taking the candidate resource path as a reduced resource path (namely an original resource path), and performing query processing in a target application environment according to the reduced domain name and the reduced resource path. By the method, the success rate and the accuracy rate of query processing can be effectively improved.
In some embodiments, before step 102, further comprising: binding the default domain name with the proxy domain name; before the candidate domain name is used as the restored domain name, the method further comprises the following steps: matching the candidate domain name with a plurality of domain name identifications; and when the candidate domain name fails to be matched with the plurality of domain name identifications, adding the candidate domain name into the candidate resource path, and taking the default domain name which has a binding relation with the proxy domain name as a new candidate domain name.
Here, the agent device may perform matching processing on the candidate domain name and a plurality of domain name identifiers, where the domain name identifiers may be set according to an actual application scenario, and may include "com", "edu", "gov", and "cn", for example. When the candidate domain name is successfully matched with any one of the domain name identifiers (namely the candidate domain name comprises any one of the domain name identifiers), the candidate domain name can be used as the restored domain name; when the matching between the candidate domain name and all domain name identifications fails, the candidate domain name is proved to be actually not the domain name, so that the candidate domain name is added to the candidate resource path, for example, the candidate domain name is added to the head of the candidate resource path, and the default domain name which has the binding relation with the proxy domain name is used as a new candidate domain name. By the method, the accuracy of the restored domain name and the restored resource path can be improved.
In step 303, the URL of the application resource obtained by the query processing is updated according to the proxy domain name.
The application resource obtained by the query processing is the application resource requested by the access request, and here, the proxy device obtains the application resource obtained by the query processing from the target application environment and updates the URL in the obtained application resource.
In step 304, the access request is responded to according to the application resource that includes the updated URL.
As shown in fig. 3C, in the embodiment of the present application, the URL in the access request is restored, and query processing is performed in the target application environment according to the restored URL, so that accuracy of resource access can be improved.
In some embodiments, referring to fig. 3D, fig. 3D is a flowchart illustrating a proxy method for applying a resource according to an embodiment of the present application, and step 101 shown in fig. 3A may be implemented through steps 401 to 405, which will be described in detail with reference to the steps.
In step 401, a proxy domain name to be bound is obtained.
For example, the proxy device may present a domain name application interface, and use the proxy domain name received at the domain name application interface as the proxy domain name to be bound.
In step 402, the existing proxy domain name corresponding to the created management directory is obtained.
Here, the proxy device acquires a proxy domain name corresponding to the created management directory, and names the proxy domain name acquired in this step as an existing proxy domain name for the sake of convenience of distinction. Wherein one management directory may correspond to one proxy domain name.
In step 403, the proxy domain name to be bound is verified according to the existing proxy domain name, and a domain name verification result is obtained.
For example, the proxy device may determine a similarity between an existing proxy domain name and a proxy domain name to be bound. When the similarity between the proxy domain name to be bound and all the existing proxy domain names is smaller than a similarity threshold value, determining that the domain name verification result is successful; and when the similarity between the proxy domain name to be bound and any one existing proxy domain name is greater than or equal to the similarity threshold, determining that the domain name verification result is verification failure. The similarity threshold may be set according to an actual application scenario, for example, set to 100%.
In step 404, when the result of the domain name verification is that the verification is successful, a management directory corresponding to the proxy domain name is created.
When the domain name verification result is that the verification fails, the proxy device may output a modification prompt (for example, the modification prompt is presented in a domain name application interface) to prompt modification of the proxy domain name to be bound; and when the domain name verification result is that the verification is successful, the agent equipment creates a management directory corresponding to the agent domain name to be bound. By the method, the uniqueness of the proxy domain name to be bound can be ensured, and the proxy domain name to be bound is prevented from being too similar (or identical) to the existing proxy domain name.
Of course, in the embodiment of the present application, the management directory corresponding to the proxy domain name to be bound may also be directly created without performing verification processing on the proxy domain name to be bound.
In step 405, in response to the operation of creating the plurality of application environments in the management directory, a binding relationship between the plurality of application environments and the proxy domain name is established.
For example, the agent device may present an environment creation interface corresponding to the management directory, and respond to an operation of creating a plurality of application environments in the environment creation interface, to create a binding relationship between the created plurality of application environments and the agent domain name to be bound, that is, to implement the binding process.
As shown in fig. 3D, in the embodiment of the present application, the binding process is implemented by creating the management directory, so that the simplicity of the binding process can be improved, and the stability and traceability of the established binding relationship can be improved.
In some embodiments, referring to fig. 3E, fig. 3E is a flowchart illustrating a proxy method for an application resource provided in this embodiment, and step 103 shown in fig. 3A may be implemented by step 501 or step 502, in step 501, a default application environment in the plurality of application environments having a binding relationship with the proxy domain name is used as a target application environment requested by the access request; wherein the default application environment is any one of the plurality of application environments.
Here, a default application environment among the plurality of application environments having a binding relationship with the proxy domain name may be set in advance, and the default application environment may be any one of the plurality of application environments, for example, may be an application environment whose creation time is the earliest. The proxy device, upon receiving an access request with the URL including the proxy domain name, may use the default application context directly as the target application context requested by the access request.
In step 502, the application environment information in the access request is obtained, and the application environment that has a binding relationship with the proxy domain name and is successfully matched with the application environment information is used as the target application environment requested by the access request.
Here, when the access request carries the application environment information, the proxy device may determine, in a plurality of application environments having a binding relationship with the proxy domain name, an application environment successfully matched with the application environment information as a target application environment requested by the access request, that is, the application environment information of the target application environment is successfully (e.g., the same as) the application environment information in the access request. The form of the application environment information is not limited in the embodiment of the present application, and may include an application environment name, for example. By the method, the flexibility of determining the target application environment can be improved.
In fig. 3E, after step 103 shown in fig. 3A, in step 503, in response to a handover operation for the target application environment, a plurality of application environments having a binding relationship with the proxy domain name may be presented.
For example, the proxy device may present one handover identifier, and present, when receiving a trigger operation for the handover identifier, a plurality of application environments having a binding relationship with the proxy domain name, where the trigger operation for the handover identifier is a handover operation for a target application environment.
In step 504, in response to the selected operation for the plurality of application environments, the selected application environment is treated as a new target application environment.
Here, when receiving a selection operation (e.g., a click operation) for the plurality of application environments that are presented, the agent device takes the selected application environment as a new target application environment. It is worth mentioning that step 503 and step 504 may also be performed after step 104. It should be noted that the switching identifier may also be presented by the client, and the proxy device may use a trigger operation for the switching identifier received by the client as a switching operation for the target application environment, and send the application environment information of the plurality of application environments having the binding relationship with the proxy domain name to the client, so that the user performs a selected operation at the client.
As shown in fig. 3E, the embodiment of the present application provides two ways of determining a target application environment, which improves flexibility; and a mode for switching the target application environment is also provided, so that the target application environment can be conveniently and quickly switched.
In the following, an exemplary application of the embodiment of the present application in an actual application scenario will be described, and for ease of understanding, the application to be proxied is a Web application as an example. The embodiment of the application provides a scheme for flexibly realizing Web resource (namely application resource in Web application) proxy based on URL updating, different application environments can be quickly and flexibly switched under the condition of keeping the proxy domain name unchanged, and the efficiency and experience of Web application in links such as development, test, product walkthrough and the like of a PC and a mobile terminal are greatly improved.
Next, description will be made from the viewpoint of visualization. The embodiment of the present application provides a schematic diagram of a domain name application interface as shown in fig. 5, and a management platform may perform binding processing on a proxy domain name received in the domain name application interface 51 and a default domain name by presenting the domain name application interface 51, where the management platform may be a platform provided by a proxy device and dedicated to implementing a proxy function. As an example, a proxy domain name fast. new.xx.com is shown in fig. 5, and a default domain name is new.xx.com, and in addition, an application name, such as a new application in fig. 5, may be received in the domain name application interface 51.
The embodiment of the present application provides a schematic diagram of a space application interface as shown in fig. 6, and a management platform may create a corresponding management space by presenting the space application interface 61 and according to a space name, a space LOGO, and a space description received in the space application interface 61, where the management space is an aggregation class of all application environments for managing a Web application and corresponds to the above management directory. By way of example, the image resource is shown in FIG. 6 with the space name of the now application and the space LOGO pointed to by "https:// not ic.gtimg.com/feeds _ pic/… …", and the space is described as the now application management space. It is worth noting that the space LOGO and the space description are not necessary information to create the management space.
The embodiment of the present application provides a schematic diagram of a domain name binding interface as shown in fig. 7, and after the creation of the management space is completed, the management platform may present a domain name binding interface 71 corresponding to the management space, and perform binding processing on the management space and the input proxy domain name in response to an operation of inputting the proxy domain name in the domain name binding interface 71. As an example, the binding relationships established by the management space with the space name now application, the application name now application, the proxy domain name fast. It should be noted that fig. 7 also shows a white list control option, and when a trigger operation for the option is received, a white list configuration interface may be presented, so that a user configures a white list corresponding to each application environment in the white list configuration interface.
The embodiment of the present application provides a schematic diagram of an environment creation interface as shown in fig. 8, where a management platform may present an environment creation interface 81 corresponding to a management space, and create an application environment of a Web application (i.e., a now application) according to application environment information received at the environment creation interface 81. As an example, fig. 8 illustrates that the application environment information includes an application environment name, an application environment type, an application environment state, a rule editing mode, and an application environment description, wherein the application environment description is not necessary information for creating the application environment, wherein the application environment type may include an Internet Data Center (IDC) application environment, a Devnet application environment, and the like, depending on a network policy actually adopted; the application environment state may include enabled and not enabled; the rule edit mode may include a form edit mode in which the agent rule is edited in the form of an input text, an editor edit mode in which the agent rule is edited by inputting a code, and the like.
After completing the creation of the application environment, the management platform may present the created plurality of application environments in the environment management interface, such as the "[ 1328] common 201 environment" shown by the environment management interface 91 in fig. 9, where "1328" is the number of the application environment and "common 201 environment" is the application environment name. In the environment management interface 91, an option of "create environment" and an option 92 of "create rule" are also shown, and upon receiving a trigger operation (e.g., a click operation) for the option 92 of "create rule", a proxy rule configuration interface may be presented. In fig. 9, the agent rule configuration interface 93 presented in the form of a window is shown, but the agent rule configuration interface 93 may also be presented in the form of a separate interface. The editing mode applied in the agent rule configuration interface 93 is a form editing mode, and can support configuration of an agent rule, an application environment, a rule state, a rule alias and a weight corresponding to the agent rule, wherein the agent rule corresponds to the content to be proxied, and the weight corresponds to the priority.
The embodiment of the present application further provides an agent rule management interface 101 as shown in fig. 10, which is used for managing configured (created) agent rules, and the management operations include but are not limited to disabling (i.e. not enabling), editing, and deleting. It is worth mentioning that the management platform can send the relevant data of the interface shown above to the client, so as to be presented in the client.
After the above steps are completed, the client may access the application resource in the Web application through the proxy domain name, for example, the client may input a URL of fast. The management platform intercepts the access request, takes a default application environment in a plurality of application environments with binding relation with the proxy domain name fast.
The client, upon receiving the application resource including the updated URL, may be presented in a browser interface. FIG. 11 illustratively shows a browser interface 111, including application resources such as "File 1" and "File 2". A gear-shaped switch identifier 112 is also shown in the browser interface 111, and when the client receives a trigger operation for the switch identifier 112, the client may present application environment information of a plurality of application environments having a binding relationship with the proxy domain name in the browser interface 111. Then, the client responds to the selection operation aiming at the plurality of application environments, and takes the selected application environment as a new target application environment, so that the switching of the target application environment can be conveniently and quickly realized. After the target application environment is switched, the client can still use the URL of fast, new, xx, com/demo.
Next, description will be made from the viewpoint of implementation of the bottom layer. First, a client may access a proxy domain name, that is, send an access request including the proxy domain name in a URL, and the access request may reach an access stratum after Load balancing, where the Load balancing is Global Load balancing (GSLB). The access layer may deploy a firewall for providing a security protection function, and after security protection, the access layer may send the access request to a forwarder and forward the access request to a gateway of the management platform by the forwarder, where the forwarder is, for example, an Nginx forwarder. And the gateway acquires the application environments accessible according to the access identity information from the data service of the management platform according to the access identity information (such as Cookie) in the access request, wherein the data service is used for storing the corresponding relation between each application environment and the identity information accessible to the application environment. Before the gateway acquires the accessible application environment, the gateway can also perform verification processing on the access identity information to judge whether the access identity information is safe.
When the number of accessible application environments is zero, that is, there is no accessible application environment, the gateway may send a hint of unauthorized access to the client, and the client may present an unauthorized interface including the hint of unauthorized access. When the number of the accessible application environments is at least one, the gateway can determine a target application environment in the accessible application environments and acquire the proxy rule corresponding to the target application environment. Meanwhile, the gateway performs query processing in the target application environment through an application environment management tool, such as a Nohost tool, to query the application resource requested by the access request.
For the application resource obtained by query processing, the gateway first determines whether the application resource includes a URL. If the application resource does not include the URL, the gateway directly sends the application resource to the client; if the application resource comprises a URL (e.g. application resources such as HTML, CSS and JavaScript), the gateway updates the URL in the application resource according to the proxy rule corresponding to the target application environment, and sends the application resource comprising the updated URL to the client. The client can present the received application resource to complete the application resource access.
As can be confirmed from fig. 12, the core of the embodiment of the present application lies in performing two parts, namely, updating the URL and performing recovery processing on the updated URL, which are described below separately.
1) And updating the URL.
For the obtained application resource including the URL, the gateway may convert the format of the application resource from the Stream format to the Buffer format, and then convert the format from the Buffer format to the String format, where the reason for converting the format into the String format is that the updating process using the String format is more convenient and faster.
And for the application resource in the String format, the gateway updates the URL in the application resource according to the proxy rule. For ease of understanding, the case where the proxy domain name is fast.new.xx.com, the default domain name is new.xx.com, and the proxy rule is new 8.gtimg.com will be illustrated hereinafter. If the URL in the application resource is now8.gtimg.com/test.js, the updated URL is lost.now.xx.com/_ tde _/now8_ gtimg _ com/_ tde _/test.js, wherein _ tde _ "is a special set domain name separator, and of course, a default domain name separator"/"in the URL may be used. In addition, at the time of the update process, the default internal delimiter "in now8.gtimg.com is replaced with a special set internal delimiter, i.e., an underline" _ ", because in the updated URL, the domain name is really fast.
It is worth noting that now8.gtimg. com is not the default domain name, so now8_ gtimg _ com remains in the updated URL. If the default domain name is updated, for example, the URL of the application resource is not.
Meanwhile, under the condition that the application resource is an HTML resource, the content of the application resource is modified, so that the integrity attribute and the cross attribute in the script tag of the application resource can be deleted, and the script tag is prevented from being loaded unsuccessfully. Wherein the integrity attribute is used to block modification of the content of the application resource; the crosstarget attribute is used to set a forbidden Cookie to be carried under a cross-domain request.
In addition, for the updated HTML resources, JavaScript resources and CSS resources, some headers can be deleted to avoid failure of the client to load the application resources. The headers to be deleted may include content-security-policy, content-encoding, and content-length, where the content-security-policy is used to limit the loading source of the application resource, that is, only the application resource of the same source can be loaded, and the application resource of the loading agent is not supported; content-encoding is used for representing compression coding of application resources, and since the application resources are decompressed and then compressed again in the updating process, actual compression coding can be different from the compression coding in the content-encoding, and error reporting can be caused; the content-length is used to indicate the content length of the application resource, and after the update processing, the actual content length of the application resource will be different from the content length indicated by the content-length, which may result in an error report.
2) And restoring the URL.
Here, the URL sent by the client is restored to ensure that the correct application resource can be queried. For example, the URL in the access request is fast. new. xx. com/_ tde _/new 8_ gtimg _ com/_ tde _/index, and the restored URL is new 8.gtimg. com/index; the URL in the access request is fast.not.xx.com/_ tde _/not 8_ gtimg _ com, and the restored URL is not 8.gtimg.com; URL in the access request is fast. not.xx. com/_ tde/not 8_ gtimg _ com/_ tde? 123, the URL restored is now8. gtimg.com? 123 — _ tde _ id.
Here, the implementation of the reduction processing is described in the form of steps.
The method comprises the following steps: splitting the content located after the first set domain name separator "_ tde _" and before the second "_ tde _" as a candidate domain name for the URL in the access request; the content located after the second "_ tde _" is split out as a candidate resource path. Where the content preceding the first "_ tde _" in the URL of the access request is the proxy domain name.
Step two: when the candidate domain name includes a default domain name separator "/", which proves that a part of the candidate domain name actually belongs to an actual resource path, deleting the content of the candidate domain name after the first "/", and adding the deleted content to the head of the candidate resource path to update the candidate resource path.
Step three: when the candidate domain name includes the parameter identification "? And if so, deleting the parameter identifier in the candidate domain name and the content after the parameter identifier, and adding the deleted content to the head of the candidate resource path to update the candidate resource path.
Step IV: updating an underline symbol "_" in the candidate domain name into "-", taking the candidate domain name as a restored domain name, taking the candidate resource path as a restored resource path, and finishing restoration processing.
After the restored domain name and the restored resource path are obtained, query processing can be performed to obtain the application resource requested by the access request.
Through the embodiment of the application, at least the following technical effects can be realized: 1) the client is not influenced by network environment, and can access application resources in both an internal network (such as a local area network) and an external network (such as a wide area network); 2) a plurality of proxy domain names do not need to be applied, and a plurality of different application environments can be accessed by only one proxy domain name; 3) the operations (such as deploying a complex proxy tool) required for accessing the application environment are greatly reduced, and only the updated URL (or proxy domain name) needs to be provided for the client.
Continuing with the exemplary structure of the application resource proxy device 455 implemented as software modules provided by the embodiments of the present application, in some embodiments, as shown in fig. 2, the software modules stored in the application resource proxy device 455 of the memory 450 may include: a binding module 4551, configured to perform binding processing on multiple application environments and the same proxy domain name; a receiving module 4552, configured to receive an access request in which a uniform resource locator URL includes a proxy domain name; a context determining module 4553, configured to determine a target application context requested by the access request, from among the plurality of application contexts having a binding relationship with the proxy domain name; an updating module 4554, configured to perform update processing on the URL of the application resource in the target application environment according to the proxy domain name, and respond to the access request according to the application resource including the updated URL.
In some embodiments, the update module 4554 is further configured to: acquiring to-be-proxied content including a domain name corresponding to a target application environment; matching the URL of the application resource in the target application environment with the content to be proxied to obtain a matching result; and when the matching result is that the matching is successful, adding the proxy domain name into the URL of the application resource, and separating the proxy domain name, the content to be proxied and the residual content in the URL of the application resource according to the domain name separator to obtain the updated URL.
In some embodiments, the number of the contents to be proxied corresponding to the target application environment includes a plurality of contents, and each content to be proxied corresponds to a priority; an update module 4554, further configured to: traversing the plurality of contents to be proxied according to the corresponding priority order of the plurality of contents to be proxied, and executing the following processing aiming at the traversed contents to be proxied: and matching the URL of the application resource in the target application environment with the traversed content to be proxied.
In some embodiments, the binding module 4551 is further configured to: binding the default domain name with the proxy domain name; an update module 4554, further configured to: and when the content to be proxied comprises a default domain name which has a binding relationship with the proxy domain name and the matching result is that the matching is successful, deleting the default domain name in the URL of the application resource so as to update the content to be proxied in the URL of the application resource.
In some embodiments, the update module 4554 is further configured to: and when the matching result is that the matching is successful, converting the domain name from the domain name format to a non-domain name format aiming at the domain name included by the content to be proxied in the URL of the application resource so as to update the content to be proxied in the URL of the application resource.
In some embodiments, the proxy device 455 for applying resources further includes a restoring module, configured to split the URL in the access request according to the domain name delimiter, so as to obtain a proxy domain name and a restored URL; an update module 4554, further configured to: performing query processing in a target application environment according to the restored URL; and updating the URL of the application resource obtained by query processing according to the proxy domain name.
In some embodiments, the update module 4554 is further configured to: splitting the reduced URL according to the domain name separator to obtain a candidate domain name and a candidate resource path; when the candidate domain name comprises the parameter identification, deleting the parameter identification in the candidate domain name and the parameter identified by the parameter identification, and adding the deleted parameter identification and the parameter into the candidate resource path; when the candidate domain name is successfully matched with the non-domain name format, converting the candidate domain name from the non-domain name format to a domain name format; and taking the candidate domain name as a reduced domain name, taking the candidate resource path as a reduced resource path, and performing query processing in a target application environment according to the reduced domain name and the reduced resource path.
In some embodiments, the binding module 4551 is further configured to: binding the default domain name with the proxy domain name; an update module 4554, further configured to: matching the candidate domain name with a plurality of domain name identifications; and when the candidate domain name fails to be matched with the plurality of domain name identifications, adding the candidate domain name into the candidate resource path, and taking the default domain name which has a binding relation with the proxy domain name as a new candidate domain name.
In some embodiments, the binding module 4551 is further configured to: acquiring a proxy domain name to be bound; creating a management directory corresponding to the agent domain name; responsive to an operation of creating a plurality of application environments in the management directory, a binding relationship between the plurality of application environments and the proxy domain name is established.
In some embodiments, the binding module 4551 is further configured to: acquiring an existing agent domain name corresponding to the created management directory; carrying out verification processing on the proxy domain name to be bound according to the existing proxy domain name to obtain a domain name verification result; and when the domain name verification result is that the verification is successful, creating a management directory corresponding to the proxy domain name.
In some embodiments, the environment determining module 4553 is further configured to: any one of the following processes is performed: acquiring application environment information in the access request, and taking an application environment which has a binding relationship with the proxy domain name and is successfully matched with the application environment information as a target application environment requested by the access request; taking a default application environment in a plurality of application environments with a binding relation with the proxy domain name as a target application environment requested by the access request; wherein the default application environment is any one of the plurality of application environments.
In some embodiments, the environment determining module 4553 is further configured to: presenting a plurality of application environments having a binding relationship with the proxy domain name in response to a switching operation for a target application environment; and in response to the selection operation of the plurality of application environments, taking the selected application environment as a new target application environment.
In some embodiments, the environment determining module 4553 is further configured to: obtaining access identity information in the access request, and verifying the access identity information to obtain an identity information verification result; when the identity information verification result is that the verification is successful, determining an application environment accessible according to the access identity information in a plurality of application environments in binding relationship with the proxy domain name; wherein each application environment corresponds to at least one accessible identity information; in at least one accessible application environment, a target application environment requested by an access request is determined.
In some embodiments, the updating module 4554 is further configured to delete at least one of the following attributes included in the application resource: a prohibited update attribute, a prohibited identity attribute, a prohibited proxy attribute, a content encoding attribute, and a content length attribute.
In some embodiments, the updating module 4554 is further configured to respond to the access request according to the application resource including the updated URL and the application resource not including the URL in the target application environment.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the agent method for applying resources, which is described in the embodiment of the present application.
Embodiments of the present application provide a computer-readable storage medium having stored therein executable instructions that, when executed by a processor, cause the processor to perform methods provided by embodiments of the present application, for example, a proxy method for an application resource as illustrated in fig. 3A, 3B, 3C, 3D, and 3E.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may, but need not, correspond to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (15)

1. A method for proxying application resources, comprising:
binding a plurality of application environments with the same agent domain name;
receiving an access request of a Uniform Resource Locator (URL) including the proxy domain name;
determining a target application environment requested by the access request in the plurality of application environments having binding relation with the proxy domain name;
and updating the URL of the application resource in the target application environment according to the proxy domain name, and responding to the access request according to the application resource comprising the updated URL.
2. The method according to claim 1, wherein the updating the URL of the application resource in the target application environment according to the proxy domain name includes:
acquiring the content to be proxied, which comprises a domain name and corresponds to the target application environment;
matching the URL of the application resource in the target application environment with the content to be proxied to obtain a matching result;
and when the matching result is that the matching is successful, adding the proxy domain name into the URL of the application resource, and separating the proxy domain name, the content to be proxied and the residual content in the URL of the application resource according to a domain name separator to obtain an updated URL.
3. The method according to claim 2, wherein the number of the contents to be proxied corresponding to the target application environment comprises a plurality of contents, and each of the contents to be proxied corresponds to a priority;
the matching processing of the URL of the application resource in the target application environment and the content to be proxied includes:
traversing a plurality of contents to be proxied according to the corresponding priority sequence of the contents to be proxied, and executing the following processing aiming at the traversed contents to be proxied:
and matching the URL of the application resource in the target application environment with the traversed content to be proxied.
4. The method of claim 2, wherein prior to receiving the uniform resource locator URL comprising the access request for the proxy domain name, the method further comprises:
binding the default domain name with the proxy domain name;
when the content to be proxied comprises a default domain name which has a binding relationship with the proxy domain name and the matching result is that the matching is successful, the method further comprises the following steps:
and deleting the default domain name in the URL of the application resource so as to update the content to be proxied in the URL of the application resource.
5. The method of claim 2, wherein when the matching result is a successful match, the method further comprises:
and aiming at the domain name included by the content to be proxied in the URL of the application resource, converting the domain name from a domain name format to a non-domain name format so as to update the content to be proxied in the URL of the application resource.
6. The method of claim 1, wherein after receiving the uniform resource locator URL comprising the access request for the proxy domain name, the method further comprises:
splitting the URL in the access request according to the domain name delimiter to obtain the proxy domain name and the reduced URL;
the updating the URL of the application resource in the target application environment according to the proxy domain name includes:
performing query processing in the target application environment according to the restored URL;
and updating the URL of the application resource obtained by the query processing according to the proxy domain name.
7. The method of claim 6, wherein the performing query processing in the target application environment according to the restored URL comprises:
splitting the reduced URL according to the domain name separator to obtain a candidate domain name and a candidate resource path;
when the candidate domain name comprises a parameter identifier, deleting the parameter identifier in the candidate domain name and the parameter identified by the parameter identifier, and adding the deleted parameter identifier and the parameter to the candidate resource path;
when the candidate domain name is successfully matched with the non-domain name format, converting the candidate domain name from the non-domain name format to a domain name format;
and taking the candidate domain name as a reduced domain name, taking the candidate resource path as a reduced resource path, and performing query processing in the target application environment according to the reduced domain name and the reduced resource path.
8. The method of claim 7, wherein prior to receiving the uniform resource locator URL comprising the access request for the proxy domain name, the method further comprises:
binding the default domain name with the proxy domain name;
before the candidate domain name is used as the restored domain name, the method further includes:
matching the candidate domain name with a plurality of domain name identifications;
and when the matching of the candidate domain name and the domain name identifications fails, adding the candidate domain name into the candidate resource path, and taking the default domain name which has a binding relation with the proxy domain name as a new candidate domain name.
9. The method according to any one of claims 1 to 8, wherein the binding multiple application environments with the same proxy domain name comprises:
acquiring a proxy domain name to be bound;
acquiring an existing agent domain name corresponding to the created management directory;
verifying the proxy domain name to be bound according to the existing proxy domain name to obtain a domain name verification result;
when the domain name verification result is that the verification is successful, creating a management directory corresponding to the proxy domain name to be bound;
in response to an operation of creating a plurality of application environments in the management directory, establishing a binding relationship between the plurality of application environments and the proxy domain name to be bound.
10. The method according to any one of claims 1 to 8, wherein the determining a target application environment requested by the access request among the plurality of application environments having a binding relationship with the proxy domain name comprises:
executing any one of the following processes:
acquiring application environment information in the access request, and taking an application environment which has a binding relationship with the proxy domain name and is successfully matched with the application environment information as a target application environment requested by the access request;
taking a default application environment in the plurality of application environments with a binding relation with the proxy domain name as a target application environment requested by the access request;
wherein the default application environment is any one of the plurality of application environments.
11. The method according to any one of claims 1 to 8, wherein after determining a target application environment requested by the access request among the plurality of application environments having a binding relationship with the proxy domain name, the method further comprises:
presenting the plurality of application environments in a binding relationship with the proxy domain name in response to a switching operation for the target application environment;
and in response to the selected operation of the plurality of application environments, taking the selected application environment as a new target application environment.
12. The method according to any one of claims 1 to 8, wherein when the URL of the application resource in the target application environment is updated according to the proxy domain name, the method further comprises:
deleting at least one of the following attributes included in the application resource:
a prohibited update attribute, a prohibited identity attribute, a prohibited proxy attribute, a content encoding attribute, and a content length attribute.
13. An agent apparatus for applying resources, comprising:
the binding module is used for binding a plurality of application environments with the same agent domain name;
a receiving module, configured to receive an access request including the proxy domain name from a uniform resource locator URL;
the environment determining module is used for determining a target application environment requested by the access request in the plurality of application environments with the binding relation with the proxy domain name;
and the updating module is used for updating the URL of the application resource in the target application environment according to the proxy domain name and responding to the access request according to the application resource comprising the updated URL.
14. An electronic device, comprising:
a memory for storing executable instructions;
a processor for implementing the proxy method of an application resource of any one of claims 1 to 12 when executing executable instructions stored in the memory.
15. A computer-readable storage medium having stored thereon executable instructions for, when executed by a processor, implementing the proxy method for application resources of any of claims 1 to 12.
CN202110266892.XA 2021-03-11 2021-03-11 Application resource proxy method and device and electronic equipment Pending CN115080883A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110266892.XA CN115080883A (en) 2021-03-11 2021-03-11 Application resource proxy method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110266892.XA CN115080883A (en) 2021-03-11 2021-03-11 Application resource proxy method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115080883A true CN115080883A (en) 2022-09-20

Family

ID=83240637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110266892.XA Pending CN115080883A (en) 2021-03-11 2021-03-11 Application resource proxy method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115080883A (en)

Similar Documents

Publication Publication Date Title
CN110221872B (en) Page jump method and device, electronic equipment and storage medium
US11032140B2 (en) Using a template to update a stack of resources
CN109885311B (en) Application program generation method and device
CN106302337B (en) Vulnerability detection method and device
US9830139B2 (en) Application experience sharing system
CN110808897A (en) Proxy access method, user equipment, storage medium, device and system
US11882154B2 (en) Template representation of security resources
CN110365724B (en) Task processing method and device and electronic equipment
CN113037891B (en) Access method and device for stateful application in edge computing system and electronic equipment
CN112799925A (en) Data acquisition method and device, electronic equipment and readable storage medium
CN112612977A (en) Page display method, system, device, equipment and storage medium
US11722481B2 (en) Multiple identity provider authentication system
CN114928484A (en) Honeypot generation method and device, electronic equipment and storage medium
CN112699034A (en) Virtual login user construction method, device, equipment and storage medium
CN112148545A (en) Security baseline detection method and security baseline detection system of embedded system
CN111552643A (en) Multi-browser webpage access synchronization method and system
CN114201370B (en) Webpage file monitoring method and system
CN115080883A (en) Application resource proxy method and device and electronic equipment
CN112507346A (en) Vulnerability scanning system
US11017032B1 (en) Document recovery utilizing serialized data
CN111158654A (en) Algorithm calling method, device, server and storage medium
CN117290840B (en) Browser auditing method, device, computer equipment and storage medium
CN113268232B (en) Page skin generation method and device and computer readable storage medium
CN111274519A (en) Page loading speed-up method
CN117806840A (en) Message template-based message display method, device, equipment, medium and product

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