CN113630468A - Dynamic proxy method - Google Patents
Dynamic proxy method Download PDFInfo
- Publication number
- CN113630468A CN113630468A CN202110938020.3A CN202110938020A CN113630468A CN 113630468 A CN113630468 A CN 113630468A CN 202110938020 A CN202110938020 A CN 202110938020A CN 113630468 A CN113630468 A CN 113630468A
- Authority
- CN
- China
- Prior art keywords
- proxy
- request
- platform
- agent
- address
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000011161 development Methods 0.000 claims abstract description 48
- 230000008569 process Effects 0.000 claims description 17
- 230000004044 response Effects 0.000 claims description 6
- 238000012360 testing method Methods 0.000 description 14
- 230000004927 fusion Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 5
- 238000000926 separation method Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 3
- 238000004088 simulation Methods 0.000 description 3
- 230000003068 static effect Effects 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000001066 destructive effect Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000013024 troubleshooting Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3664—Environments for testing or debugging software
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/566—Grouping or aggregating service requests, e.g. for unified processing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a dynamic proxy method, which comprises the following steps: configuring an agent address of a front-end project in an agent platform, wherein the agent platform identifies the type and the developer of the front-end project according to the identifier of the front-end project and the corresponding interface data address; when an Api request of a front-end item is received, the proxy platform switches a proxy address of the front-end item to a target address corresponding to the Api request; the invention has the advantages that: the efficiency of development and joint debugging is improved.
Description
Technical Field
The invention relates to the field of proxy address switching of front-end and back-end project development, in particular to a dynamic proxy method.
Background
In a traditional development mode, taking a Java Web project as an example, front-end code (Html, JavaScript, Css) is written in JSP. When a user accesses a website, the JSP is compiled into a Servlet, and then the Html, JavaScript and Css codes in the JSP are output to a browser.
From the development perspective, in the development process, developers need to design not only a rear-end architecture but also front-end display, and most of the whole process is serial, so that the development efficiency is low, and the development period is prolonged. From the maintenance perspective, the front-end code and the back-end code are coupled together, so that the codes are disorderly, the maintainability of the project is greatly reduced, and the maintenance cost is increased.
In recent years, a new development mode of front-end and back-end separation is promoted, for example, a new development mode of front-end and back-end separation is introduced in detail in a master professional academic paper "interactive mode research and application based on front-end and back-end separation" published in 2021, 2 and 5. The back-end is only responsible for the interface to return the required data logic and the front-end is responsible for rendering the HTML page (the page effect is fully controlled by the front-end). Therefore, the division of labor is more definite, the coupling degree of the front end and the rear end is greatly lower, the maintainability of the code is enhanced, and the overall efficiency is obviously improved. In a new development mode with front-end and back-end separation, each view developed by the back-end is generally called an interface (Api), and the front-end performs incremental and destructive inspection on data through the Api. Therefore, as shown in fig. 1, the development flow is changed from the previous serial development to front-end and back-end parallel development. Specifically, the method comprises the following steps:
the first step is as follows: after the requirement is determined, the front end and the back end jointly make an interface document (contract);
the second step is that: a back-end development interface, a front-end parallel development page;
the third step: and (4) joint debugging of the front end and the rear end, and performing integrated test after joint debugging.
In the front-end and back-end parallel development process, the front end needs to be attached to the background interface data. But the process is a parallel process and therefore the return of the Api Mock analog interface becomes necessary. With respect to the above mentioned Api Mock simulation mechanism, a similar approach is commercially available as follows:
two services are required to be started locally during front-end development, one service is used for supporting web static resources, and the other service is used for simulating a background API (application programming interface). The static resource service comprises a proxy API address function, and the proxy function is used for forwarding background interface data (common interface prefixes all have the same characteristics, such as beginning with 'API/') sent by the server to the service of the background API interface. Then there are roughly 3 usage scenarios as shown in fig. 2:
1. when developing the front-end page, the agent will be set to the service of the local emulation back-end API interface (as in FIG. 2 development Environment Address: http:// localhost:8080)
2. When associated with the background interface, the agent will be set to the background API interface service (e.g., background Environment Address: http://192.168.0.100:8080 in FIG. 2)
3. During the testing phase, the front-end troubleshooting a problem may set the agent to the API interface services of the test environment (e.g., test environment address: http://192.168.0.200:8080 in FIG. 2).
One problem with this approach is: when joint debugging is possible one-to-many (one front-end developer joint debugging with a plurality of background developers), a plurality of background developers mean that there are addresses of a plurality of background environments. After the joint debugging with the background A is completed, the agent needs to be switched to the background B, and the agent can be crossly coordinated with the background A and the background B in such a way of rotation. In the current front-end project mechanism, the proxy address needs to be changed, and the specific steps include:
the first step is as follows: modifying the ip address in the configuration file;
the second step is that: killing the front-end service;
the third step: restart the front-end services (this process will execute the compilation process of the front-end static resources, with different starting speeds depending on the size of the project).
In conclusion, many irrelevant things need to be additionally done to change the proxy address, which affects the efficiency of development and joint debugging.
Another problem is also caused: a front-end developer tends to intersperse among multiple front-end projects. Such as the following scenarios: multiple entries in parallel may cause a problem with proxy address port conflicts, which also requires frequent modification of proxy addresses and then restart of the front-end entries.
Disclosure of Invention
The invention aims to solve the technical problem that the efficiency of development and joint debugging is influenced by frequently modifying the proxy address in the development of front-end and back-end projects in the prior art.
The invention solves the technical problems through the following technical means: a method of dynamic proxying, the method comprising:
configuring an agent address of a front-end project in an agent platform, wherein the agent platform identifies the type and the developer of the front-end project according to the identifier of the front-end project and the corresponding interface data address;
and when receiving an Api request of a front-end item, the proxy platform switches the proxy address of the front-end item to a target address corresponding to the Api request.
The invention sends the identifications of all front-end projects and corresponding interface data addresses to the agent platform, the agent platform receives the Api request of the front-end projects and identifies corresponding identifications to determine different projects and different developers, the agent platform carries out forwarding processing according to the Api request and switches to the target address corresponding to the Api request of the front-end project, when a plurality of projects are parallel, the projects are only required to be forwarded to different target addresses according to the Api request, the agent address is not required to be frequently modified, the front-end projects are not required to be restarted, the development efficiency is improved, the agent address is only required to be modified and configured on the agent platform, and the development and joint debugging efficiency is improved.
Furthermore, different interface data correspond to different branch tasks, and a plurality of related branch task sets form a front-end project.
Furthermore, the branch task corresponding to the current interface data is a main line stable branch, the branch task corresponding to the interface data generated after the current interface data is modified is an integrated test branch, each developer creates a personal branch according to the integrated test branch, develops functions and modules responsible for the personal, requests the personal branches to be merged into the integrated test branch after the development is completed, and after all the personal branches are merged into the integrated test branch, the integrated test branch is merged with the main line stable branch to form a front-end project.
Furthermore, the proxy platform calls, edits or adds new interface data and corresponding branch tasks.
Further, the agent platform includes an agent mode, and in the agent mode, the agent platform switches the agent address to the corresponding target address according to refer in the request header of the Api request of the current front-end item.
Further, the agent platform comprises a Mock mode, and under the Mock mode, the agent platform pulls the interface data of the current front-end project or the current branch task according to the identification of the front-end project, so that the front-end project or the current branch task operates independently.
Further, the process that the agent platform switches the agent address to the corresponding target address according to refer in the request header of the Api request of the current front-end item includes the following steps:
s1: the method comprises the following steps that an Api request is sent to a front-end development server by a browser or a client, the front-end development server receives the request, sets fields and identifications needed by an agent platform in a request header, and forwards the request to the agent platform;
s2: the agent platform receives the request;
s3: the agent platform judges whether the request hits the agent setting of the referrer, if yes, S9 is executed, otherwise, S4 is executed;
s4: the agent platform judges whether the global agent is started, if yes, S9 is executed, otherwise, S5 is executed;
s5: the agent platform judges whether an interface data file corresponding to the request exists, if so, S7 is executed, otherwise, S6 is executed;
s6: creating a corresponding interface data file and generating a universal interface format;
s7: reading the corresponding interface data file content;
s8: returning the read interface data, and executing S11;
s9: forwarding the request to the set proxy address;
s10: the background server responds to the interface;
s11: the front-end development server receives the response;
s12: the browser or the client receives the response, and the request is finished.
Further, the agent platform identifies different developers according to the Referer in the request header of the Api request to switch the agent address to different target addresses.
Furthermore, the agent platform is respectively connected with the client and the background server in a Websocket or http mode.
And further, the agent platform switches the agent address to the corresponding target address in a Websocket or http mode according to a Referer in a request header of an Api request of the current front-end item in the agent mode.
Further, the interface data is stored in a JSON file mode.
The invention has the advantages that:
(1) the invention sends the identifications of all front-end projects and corresponding interface data addresses to the agent platform, the agent platform receives the Api request of the front-end projects and identifies corresponding identifications to determine different projects and different developers, the agent platform carries out forwarding processing according to the Api request and switches to the target address corresponding to the Api request of the front-end project, when a plurality of projects are parallel, the projects are only required to be forwarded to different target addresses according to the Api request, the agent address is not required to be frequently modified, the front-end projects are not required to be restarted, the development efficiency is improved, the agent address is only required to be modified and configured on the agent platform, and the development and joint debugging efficiency is improved.
(2) For the scene of collaborative development of the same front-end project, the agent platform identifies different developers according to referers in a request header of an Api request, and performs difference forwarding, so that the collaborative development of the same front-end project by multiple persons is realized.
(3) The agent platform supports Websocket connection or http connection, and can realize online simulation of relevant data feedback and real-time viewing of effects through the Websocket connection.
(4) Compared with the data storage mode in the DB format in the prior art, the data storage method in the JSON file mode has the advantages that the independent DB service is not required to be built, the storage process is simplified, and the method is convenient and efficient.
Drawings
FIG. 1 is a schematic diagram of a front-end and back-end parallel development process in the prior art;
FIG. 2 is a schematic diagram of a processing manner of an Api Mock simulation mechanism in the prior art;
fig. 3 is a flowchart illustrating a method for dynamic proxy according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating an embodiment of a branch task forming front-end project in a dynamic proxy method according to an embodiment of the present invention;
fig. 5 is a schematic diagram illustrating a flow of a single Api request in a dynamic proxy method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 3, a method of dynamic proxying, the method comprising: a proxy platform (Fusion Mock shown in fig. 3 is the proxy platform), the proxy target addresses of all front-end projects are the proxy platform, the identifications of all front-end projects and the corresponding interface Mock data addresses are sent to the proxy platform, the proxy platform receives the Api requests of the front-end projects and determines different projects and developers by identifying the corresponding identifications, and the proxy platform performs forwarding processing according to the Api requests and switches to the target addresses corresponding to the Api requests of the front-end projects. The process of the present invention is described in detail below.
Continuing with fig. 3, the Mock Data (File) in fig. 3 is an interface Data File, different interface Data correspond to different branch tasks, and a plurality of related branch tasks are collected to form a front-end item. For example, in fig. 3, each front-end item is a set of different branch tasks, and a front-end item includes three branch tasks, and each of the three branch tasks has its corresponding interface data file. As shown in fig. 4, a specific example is given, where the branch task corresponding to the current interface data is a main line stable branch, the branch task corresponding to the interface data generated after the current interface data is modified is an integrated test branch, each developer creates a personal branch according to the integrated test branch, develops a function and a module responsible for the individual, requests the individual branch to merge into the integrated test branch after the development is completed, and after all the personal branches merge into the integrated test branch, the integrated test branch merges with the main line stable branch to form a front-end item.
Each front-end item can send an Api request to a proxy platform, that is, a Fusion mock, through a front-end development server, a field and an identifier required by the proxy platform are set in the Api request, for example, each front-end item has a unique identifier, the Fusion mock can determine the identity information of the front-end item according to the identifier, that is, determine which front-end item the Fusion mock belongs to and a corresponding developer, refer in a request header also performs proxy setting, and the proxy platform can switch a proxy address to a corresponding target address according to refer in the request header, for example, in fig. 3, the proxy address can be switched to environment one, environment two or environment three.
And the agent platform interacts with the interface data, and calls, edits or adds new interface data and corresponding branch tasks to the interface data. For example, a new interface data file and a corresponding branch task are added to the front-end item one, the identifier of the front-end item one can be searched on the proxy platform, the address of the front-end item one is found, and a new address is created for storing new interface data.
In the traditional front-end and back-end separation project development process, if switching among different agents is needed (frequent operation is needed in actual work), target configuration needs to be modified, then the whole project is reconstructed, and the reconstruction is a very time-consuming process; and different developers connect different targets, and conflicts (or related configurations restored by submitting each time) can be generated in the code submitted by the git database. The whole process is very complicated and is easy to make mistakes. The proxy address can be unified through the Fusion Mock, and all project owners can be uniformly configured to the service address of the Fusion Mock (such as 192.168.0.135: 18080); different items are associated through fields in the Referer in the request header of the Api request. The connection address switching does not need to be reconstructed, and only needs to be dynamically modified on a tool. The proxy process of the proxy platform is described in detail below.
The agent platform comprises a Mock mode and an agent mode, interface data of a current front-end project or a current branch task are pulled according to the identification of the front-end project in the Mock mode to enable the front-end project or the current branch task to operate independently, and an agent address is switched to a corresponding target address according to a Referer in a request header of an Api request of the current front-end project in the agent mode. The proxy platform supports Websocket connection or http connection. And the agent platform switches the agent address to the corresponding target address in a Websocket or http mode according to a Referer in a request header of an Api request of the current front-end item in the agent mode.
As shown in fig. 5, the process of the agent platform switching the agent address to the corresponding target address according to refer in the request header of the Api request of the current front-end item includes the following steps:
s1: the method comprises the following steps that an Api request is sent to a front-end development server by a browser or a client, the front-end development server receives the request, sets fields and identifications needed by an agent platform in a request header, and forwards the request to the agent platform;
s2: the agent platform receives the request;
s3: the agent platform judges whether the request hits the agent setting of the referrer, if yes, S9 is executed, otherwise, S4 is executed;
s4: the agent platform judges whether the global agent is started, if yes, S9 is executed, otherwise, S5 is executed;
s5: the agent platform judges whether an interface data file corresponding to the request exists, if so, S7 is executed, otherwise, S6 is executed;
s6: creating a corresponding interface data file and generating a universal interface format;
s7: reading the corresponding interface data file content;
s8: returning the read interface data, and executing S11;
s9: forwarding the request to the set proxy address;
s10: the background server responds to the interface;
s11: the front-end development server receives the response;
s12: the browser or the client receives the response, and the request is finished.
As a further improvement of the invention, the agent platform identifies different developers according to the Referer in the request header of the Api request, performs difference forwarding, and realizes multi-user collaborative development. For online collaborative development of the same project, multiple developers need to connect to different target servers. The traditional mode cannot be realized, only serial operation (development A and development B are carried out after the development A is finished) is realized, and the efficiency is low. And the Fusion Mock can identify the Referer in the request head of the Api request to identify different developers for difference forwarding, and the different developers can be connected to different target addresses to perform joint debugging or interface dredging and the like.
As a further improvement of the invention, the interface data is stored in a JSON file mode. Using JSON file storage (one JSON file for each interface) there is no need to build a separate DB service. And related JSON files are simple to manage and can be managed to a Git and other related code warehouses along with projects.
Through the technical scheme, the identifiers of all front-end projects and corresponding interface data addresses are sent to the agent platform, the agent platform receives the Api request of the front-end projects and identifies corresponding identifiers to determine different projects and different developers, the agent platform performs forwarding processing according to the Api request and switches to the target address corresponding to the Api request of the front-end project, when a plurality of projects are parallel, the projects are only required to be forwarded to different target addresses according to the Api request, the agent address does not need to be frequently modified, the front-end projects do not need to be restarted, the development efficiency is improved, the agent address is only required to be modified and configured on the agent platform, the target IP address or the domain name to be modified does not need to be additionally done, and the development and joint debugging efficiency is improved.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (9)
1. A method for dynamic proxying, the method comprising:
configuring an agent address of a front-end project in an agent platform, wherein the agent platform identifies the type and the developer of the front-end project according to the identifier of the front-end project and the corresponding interface data address;
and when receiving an Api request of a front-end item, the proxy platform switches the proxy address of the front-end item to a target address corresponding to the Api request.
2. The method of dynamic proxy of claim 1, wherein different interface data correspond to different branch tasks, and a plurality of associated branch task sets form a front end item.
3. The method of dynamic proxy of claim 1, wherein the proxy platform calls, edits or adds new interface data and its corresponding branch task.
4. The method of dynamic proxy of claim 1, wherein the proxy platform includes a proxy mode, and in the proxy mode, the proxy platform switches the proxy address to the corresponding target address according to a refer in a request header of an Api request of a current front-end item.
5. The method for dynamic proxy of claim 1, wherein the proxy platform comprises a Mock mode, and in the Mock mode, the proxy platform pulls the interface data of the current front-end item or the current branch task according to the identification of the front-end item, so that the front-end item or the current branch task runs independently.
6. The method for dynamic proxy according to claim 4, wherein the process of the proxy platform switching the proxy address to the corresponding target address according to refer in the request header of the Api request of the current front-end item comprises the following steps:
s1: the method comprises the following steps that an Api request is sent to a front-end development server by a browser or a client, the front-end development server receives the request, sets fields and identifications needed by an agent platform in a request header, and forwards the request to the agent platform;
s2: the agent platform receives the request;
s3: the agent platform judges whether the request hits the agent setting of the referrer, if yes, S9 is executed, otherwise, S4 is executed;
s4: the agent platform judges whether the global agent is started, if yes, S9 is executed, otherwise, S5 is executed;
s5: the agent platform judges whether an interface data file corresponding to the request exists, if so, S7 is executed, otherwise, S6 is executed;
s6: creating a corresponding interface data file and generating a universal interface format;
s7: reading the corresponding interface data file content;
s8: returning the read interface data, and executing S11;
s9: forwarding the request to the set proxy address;
s10: the background server responds to the interface;
s11: the front-end development server receives the response;
s12: the browser or the client receives the response, and the request is finished.
7. The method for dynamic proxy of claim 4 wherein the proxy platform identifies different developers according to referers in the request header of the Api request to switch proxy addresses to different target addresses.
8. The method for dynamic proxy of claim 1, wherein the proxy platform is connected to the client and the backend server by means of Websocket or http.
9. The method of dynamic proxy of claim 1 wherein the interface data is stored in a JSON file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110938020.3A CN113630468B (en) | 2021-08-16 | 2021-08-16 | Dynamic proxy method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110938020.3A CN113630468B (en) | 2021-08-16 | 2021-08-16 | Dynamic proxy method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113630468A true CN113630468A (en) | 2021-11-09 |
CN113630468B CN113630468B (en) | 2023-12-22 |
Family
ID=78385710
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110938020.3A Active CN113630468B (en) | 2021-08-16 | 2021-08-16 | Dynamic proxy method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113630468B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114327416A (en) * | 2022-03-17 | 2022-04-12 | 云账户技术(天津)有限公司 | Interface synchronization method and device applied to development branch and electronic equipment |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070277158A1 (en) * | 2006-02-24 | 2007-11-29 | International Business Machines Corporation | Method and apparatus for testing of business processes for Web services |
US20130239096A1 (en) * | 2012-03-08 | 2013-09-12 | Business Objects Software Ltd. | Application Programming Interface Tracing Mechanism |
CN106528400A (en) * | 2016-09-22 | 2017-03-22 | 深圳峰创智诚科技有限公司 | MOCK testing method and device |
CN109067914A (en) * | 2018-09-20 | 2018-12-21 | 星环信息科技(上海)有限公司 | Proxy Method, device, equipment and the storage medium of Web service |
CN110191013A (en) * | 2019-04-19 | 2019-08-30 | 深圳壹账通智能科技有限公司 | Electronic device, the Mock test method of more capital's interfaces and storage medium |
CN110334000A (en) * | 2019-05-07 | 2019-10-15 | 重庆天蓬网络有限公司 | A kind of test method based on MOCK technology |
CN110362491A (en) * | 2019-07-17 | 2019-10-22 | 广州市有车以后信息科技有限公司 | A kind of mock test method and test device based on go-between's agent skill group |
CN111427766A (en) * | 2020-02-20 | 2020-07-17 | 北京齐尔布莱特科技有限公司 | Request processing method and device and proxy server |
CN111782535A (en) * | 2020-06-30 | 2020-10-16 | 京东数字科技控股股份有限公司 | Test method and device |
CN112015573A (en) * | 2020-08-25 | 2020-12-01 | 云账户技术(天津)有限公司 | Interface data simulation method and device and electronic equipment |
US20210096825A1 (en) * | 2019-09-30 | 2021-04-01 | Salesforce.Com, Inc. | Systems, methods, and apparatuses for local web components development within a cloud based computing environment |
-
2021
- 2021-08-16 CN CN202110938020.3A patent/CN113630468B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070277158A1 (en) * | 2006-02-24 | 2007-11-29 | International Business Machines Corporation | Method and apparatus for testing of business processes for Web services |
US20130239096A1 (en) * | 2012-03-08 | 2013-09-12 | Business Objects Software Ltd. | Application Programming Interface Tracing Mechanism |
CN106528400A (en) * | 2016-09-22 | 2017-03-22 | 深圳峰创智诚科技有限公司 | MOCK testing method and device |
CN109067914A (en) * | 2018-09-20 | 2018-12-21 | 星环信息科技(上海)有限公司 | Proxy Method, device, equipment and the storage medium of Web service |
CN110191013A (en) * | 2019-04-19 | 2019-08-30 | 深圳壹账通智能科技有限公司 | Electronic device, the Mock test method of more capital's interfaces and storage medium |
CN110334000A (en) * | 2019-05-07 | 2019-10-15 | 重庆天蓬网络有限公司 | A kind of test method based on MOCK technology |
CN110362491A (en) * | 2019-07-17 | 2019-10-22 | 广州市有车以后信息科技有限公司 | A kind of mock test method and test device based on go-between's agent skill group |
US20210096825A1 (en) * | 2019-09-30 | 2021-04-01 | Salesforce.Com, Inc. | Systems, methods, and apparatuses for local web components development within a cloud based computing environment |
CN111427766A (en) * | 2020-02-20 | 2020-07-17 | 北京齐尔布莱特科技有限公司 | Request processing method and device and proxy server |
CN111782535A (en) * | 2020-06-30 | 2020-10-16 | 京东数字科技控股股份有限公司 | Test method and device |
CN112015573A (en) * | 2020-08-25 | 2020-12-01 | 云账户技术(天津)有限公司 | Interface data simulation method and device and electronic equipment |
Non-Patent Citations (1)
Title |
---|
""发明专利公开 -- 一种基于 JSON 文件 + Http Header 的支持多项目、多分支、多人协同的 Api Mock"", Retrieved from the Internet <URL:https://cloud.tencent.com/developer/article/2293401> * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114327416A (en) * | 2022-03-17 | 2022-04-12 | 云账户技术(天津)有限公司 | Interface synchronization method and device applied to development branch and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113630468B (en) | 2023-12-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111045655B (en) | Page rendering method and device, rendering server and storage medium | |
US5594910A (en) | Interactive computer network and method of operation | |
CN109542427B (en) | System customization method and device, electronic equipment and storage medium | |
CN101398845B (en) | Multi-language binding method and system in web applications | |
CN110347942A (en) | Method for page jump, device, storage medium and computer equipment | |
JPH04233654A (en) | Multiple-process operating system | |
CN111639279B (en) | Graphic code generation method, target page loading method and device | |
CN112988572A (en) | Multi-environment multi-channel multi-version simulation test method and device | |
CN110519127B (en) | Network delay detection method, device and storage medium | |
CN109857391A (en) | Processing method and processing device, storage medium and the electronic device of data | |
CN112015573A (en) | Interface data simulation method and device and electronic equipment | |
CN113094255A (en) | Simulation test method, device and system for data interface | |
CN110727429A (en) | Front-end page generation method, device and equipment | |
CN113630468A (en) | Dynamic proxy method | |
CN111078424A (en) | Information interaction method and device, computer equipment and storage medium | |
CN110909290A (en) | Method and system for combining multiple systems into large single-page application | |
CN110380930B (en) | Test method, test device, server and computer storage medium | |
CN112068879A (en) | Method and device for constructing client application development framework based on configuration | |
Hinze et al. | Interaction design for a mobile context-aware system using discrete event modelling | |
CN114285779B (en) | Processing method, device and system of test request | |
CN114124766B (en) | Test method and device based on simulation data | |
CN115186214A (en) | Page configuration method and device, computer equipment and computer readable storage medium | |
CN112637074B (en) | Web static resource coordination method, device and distribution system | |
CN115857956B (en) | Multi-site deployment processing method and system | |
CN118170679A (en) | Function debugging method for BMC (baseboard management controller) management webpage, web server, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |