Access method, proxy server, electronic device, and storage medium
By dynamically switching between RBI and domain rewriting methods via a proxy server, the issue of poor webpage rendering in WebVPN was resolved, achieving optimal page presentation under different access methods and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2026-04-14
AI Technical Summary
Existing WebVPN technologies do not render web pages well in client browsers. RBI methods do not directly load the page, resulting in poor audio and video content rendering. Domain rewriting methods have code compatibility issues because they require rewriting response information.
This provides a proxy server that supports both RBI and domain rewriting methods, dynamically switching based on access requests to ensure client browsers access web pages in the best way. It receives access requests from client browsers and initiates access to the origin server, returning resource code data or pixel stream data to achieve optimal page presentation.
It improves the rendering effect of web pages in client browsers, enhances user experience, solves the independent implementation problem between RBI method and domain name rewriting method, and achieves the best page presentation under different access methods.
Smart Images

Figure CN115563412B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to an access method, a proxy server, an electronic device, and a storage medium. Background Technology
[0002] Web Virtual Private Networks (WebVPNs) provide web-based access control for intranet applications, allowing authorized users to access web applications that are only accessible within the intranet, achieving functionality similar to Virtual Private Networks (VPNs). Currently, WebVPNs primarily employ two implementation methods: Remote Browser Isolation (RBI) and Domain Name Rewriting. RBI uses an isolated browser as a bridge between the client browser and the origin server: the client browser's access request is forwarded to the origin server via the isolated browser. The response from the origin server is first loaded on the isolated browser, and then the loaded page is returned to the client browser via pixel-by-pixel push, allowing the client browser to reconstruct the page based on the received pixel information. Domain Name Rewriting, on the other hand, involves the proxy server rewriting the actual domain name in the response to the client browser's request after the origin server responds, replacing it with the proxy domain name before sending it to the client browser.
[0003] However, current WebVPNs suffer from poor webpage rendering in client browsers: RBI (Redirect Bidding) renders pages by pixel-by-pixel pushing and reconstruction instead of directly loading them, resulting in poor rendering of webpages containing audio and video content; Domain Name Rewriting (DNR) requires rewriting the information in the response returned by the origin server, leading to code compatibility issues that also affect webpage rendering. Summary of the Invention
[0004] The purpose of this application is to provide an access method, proxy server, electronic device, and storage medium that enable web pages accessed by the client browser to be presented to the user with the best effect, thereby improving the user experience.
[0005] To achieve the above objectives, embodiments of this application provide an access method applied to a proxy server. The method includes: after returning first response data to a client browser based on a first access request sent by the client browser, receiving a second access request sent by the client browser, and initiating access to the origin server according to the second access request, wherein the URLs carried by the first access request and the second access request have the same main domain name; sending second response data generated based on resource code data returned by the origin server to the client browser, wherein the first response data includes one of resource code data and pixel stream data, and the second response data includes the other of resource code data and pixel stream data.
[0006] To achieve the above objectives, embodiments of this application also provide a proxy server, comprising: a first processing module, configured to receive a second access request sent by the client browser after returning first response data to the client browser based on a first access request sent by the client browser, and initiate access to the origin server according to the second access request, wherein the URLs carried by the first access request and the second access request have the same main domain name; and a second processing module, configured to send second response data generated based on resource code data returned by the origin server to the client browser, wherein the first response data includes one of resource code data and pixel stream data, and the second response data includes the other of resource code data and pixel stream data.
[0007] To achieve the above objectives, embodiments of this application also provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the access method as described above.
[0008] To achieve the above objectives, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the access method described above.
[0009] The access method provided in this application, after returning a first response data to the client browser based on a first access request sent by the client browser, can receive a second access request sent by the client browser and initiate access to the origin server according to the second access request. The URLs carried by the first and second access requests have the same main domain name. A second response data generated based on the resource code data returned by the origin server is sent to the client browser. The first response data includes one of resource code data and pixel stream data, and the second response data includes the other of resource code data and pixel stream data. That is, after accessing a webpage under the main domain name using RBI and obtaining pixel stream data as response data, it is still possible to access the webpage under the main domain name again using domain name rewriting and obtain resource code data as response data; or, after accessing a webpage under the main domain name using domain name rewriting and obtaining resource code data as response data, it is still possible to access the webpage under the main domain name again using RBI and obtain pixel stream data as response data. In other words, the proxy server supports both RBI and domain rewriting methods. This allows the webpage to be accessed in RBI mode when it has the best page rendering effect, and in domain rewriting mode when it has the best page rendering effect. This ensures that the webpage accessed by the client browser is presented to the user with the best effect, which helps to improve the user experience. Attached Figure Description
[0010] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0011] Figure 1 This is a flowchart of an access method provided in one embodiment of this application;
[0012] Figure 2 This is a flowchart of an access method including the step of determining a target access method, provided in another embodiment of this application;
[0013] Figure 3 This is a flowchart of an access method including the step of determining the target access method as RBI, provided in another embodiment of this application;
[0014] Figure 4 This is a flowchart of an access method provided in another embodiment of this application, which includes the step of determining the target access method as domain name rewriting.
[0015] Figure 5 This is a flowchart of an access method including the step of storing target verification information, provided in another embodiment of this application;
[0016] Figure 6 This is a flowchart of an access method including the step of obtaining target verification information based on an API, provided in another embodiment of this application;
[0017] Figure 7 This is a flowchart of an access method including the step of obtaining target verification information based on a browser interface protocol, provided in another embodiment of this application;
[0018] Figure 8 This is a flowchart of an access method including a step of generating a callback event, provided in another embodiment of this application;
[0019] Figure 9 This is a schematic diagram of the proxy server structure provided in another embodiment of this application;
[0020] Figure 10 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation
[0021] As the background technology shows, current WebVPNs suffer from poor webpage rendering in client browsers.
[0022] Analysis revealed that one reason for the aforementioned problem is that when accessing a page multiple times, the request typically includes verification information stored from the previous visit. This allows the origin server to verify the user's identity on the client browser, eliminating the need for additional information from the user, simplifying the verification process, and improving user experience. However, the storage locations of verification information differ between RBI and DNS rewriting methods: in RBI, page loading and actual interaction with the webpage occur on an isolated browser, where verification information is typically stored; while in DNS rewriting, page loading and interaction occur on the client browser, where verification information is typically stored. Therefore, even with simple combinations of RBI and DNS rewriting, RBI still retrieves verification information from the isolated browser used in the previous RBI-based WebVPN implementation, and DNS rewriting still retrieves it from the client browser used in the previous DNS rewriting-based WebVPN implementation. The existing methods, RBI and domain rewriting, suffer from incompatible verification information and remain independently implemented. Consequently, those skilled in the art typically avoid combining them. When implemented independently, RBI, by using pixel-by-pixel push and reconstruction instead of direct page loading, performs poorly on webpages containing audio and video content. Domain rewriting, requiring modification of the response from the origin server, suffers from code compatibility issues, also impacting page rendering. Therefore, current WebVPNs consistently exhibit poor webpage rendering in client browsers.
[0023] To address the aforementioned issues, this application provides an access method applied to a proxy server. The method includes: after returning first response data to a client browser based on a first access request sent by the client browser, receiving a second access request sent by the client browser, and initiating access to the origin server according to the second access request, wherein the URLs carried by the first access request and the second access request have the same main domain name; and sending second response data generated based on resource code data returned by the origin server to the client browser, wherein the first response data includes one of resource code data and pixel stream data, and the second response data includes the other of resource code data and pixel stream data.
[0024] The access method provided in this application embodiment supports both RBI and domain name rewriting methods based on the proxy server. Specifically, it supports accessing a webpage under the main domain using RBI and obtaining pixel stream data as response data, and then accessing the webpage under the same main domain again using domain name rewriting to obtain resource code data as response data. Furthermore, it supports accessing the webpage under the same main domain again using domain name rewriting and obtaining resource code data as response data, and then accessing the webpage under the same main domain again using RBI and obtaining pixel stream data as response data. This overcomes the technical bias that RBI and domain name rewriting methods are usually not combined, enabling access to the webpage using RBI when it provides the best page presentation effect, and accessing the webpage using domain name rewriting when it provides the best page presentation effect. This allows for dynamic switching between RBI and domain name rewriting methods based on different access requests, ensuring that the webpage accessed by the client browser is presented to the user with the best effect, thus improving the user experience.
[0025] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been presented in the various embodiments of this application to enable readers to better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments.
[0026] The division of the following embodiments is for ease of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.
[0027] This application provides an access method for a proxy server, which provides WebVPN services to client browsers. The access method flow is as follows: Figure 1 As shown, it includes at least the following steps:
[0028] Step 101: After returning the first response data to the client browser based on the first access request sent by the client browser, receive the second access request sent by the client browser, and initiate access to the origin site according to the second access request. The URLs carried by the first access request and the second access request have the same main domain name.
[0029] In this embodiment, the client browser is the browser configured on the client. Generally, when a user accesses a webpage, they usually do so by operating the browser on the client to send access requests to the proxy server, such as searching for a website address or clicking a webpage link on the browser page. The main domain is the common domain portion shared by all domains pointing to the same origin site. The main domain may be a second-level domain or a third-level domain, such as a second-level domain A.com with subdomains like music.A.com and map.A.com. These subdomains all point to the origin site with the domain A.com, in which case the second-level domain A.com is the main domain. It is important to emphasize that for all domains pointing to the same origin site, the verification information for the same user should be identical; otherwise, the amount of user verification information to manage would be excessive and inconvenient.
[0030] It should be noted that the first access request and the second access request have the same main domain name, which means that the first access request and the second access request can be associated based on the verification information. For example, the webpage accessed by the first access request and the webpage accessed by the second access request can pass the verification based on the same verification information. In other words, after the first access request is responded to, the second access request can initiate access again based on the verification information in the response process of the first access request, without having to go through the verification process again.
[0031] It's also important to note that the domain name included in the access requests sent by the client browser (including the first and second access requests) is the proxy domain name of the origin server, not the real domain name of the origin server. Using a proxy domain name hides the real domain name of the origin server, thus improving its security. This request, based on the proxy domain name, is transmitted to the proxy server. Upon receiving the access request, the proxy server queries the proxy domain name to determine the real domain name of the origin server corresponding to the request, and then initiates access to the origin server based on that real domain name. For example, if the Uniform Resource Locator (URL) carried in the access request sent by the client is https: / / B.proxy.com / login, the origin server domain name resolved and found by the proxy server is www.B.com.
[0032] Step 102: Send the second response data generated based on the resource code data returned by the origin server to the client browser. The first response data includes one of the resource code data and the pixel stream data, and the second response data includes the other of the resource code data and the pixel stream data.
[0033] In this embodiment, the resource code data includes code data in at least one of the following formats as the scripting language: Hyper Text Markup Language (HTML), Cascading Style Sheets (CSS), JavaScript (JS).
[0034] It's important to note that regardless of whether it's RBI or DNS rewriting, the response received by the proxy server is resource code data. However, in RBI, page loading occurs on the isolated browser, and the client browser receives the image data of the loaded page; therefore, pixel stream data is returned to the client browser. In DNS rewriting, page loading occurs on the client browser, but the domain names of links on the page loaded by the client browser are rewritten; therefore, resource code data is returned to the client browser, but it differs from the resource data returned by the origin server. In other words, the first response data includes either resource code data or pixel stream data, and the second response data includes the other. This means that the first access request uses one of the access methods: RBI or DNS rewriting, and the second access request corresponding to the second response data uses the other of the two methods. Therefore, the practical meaning of this embodiment is that the proxy server uses different methods to initiate access to the origin server and return responses to the client browser for the first and second access requests, respectively. In other words, the proxy server supports both RBI and domain rewriting methods. This allows it to respond to different access requests by using either RBI or domain rewriting methods, ensuring that the webpages accessed by the client browser are presented to the user in the best possible way, thus improving the user experience.
[0035] Based on this, in some embodiments, in addition to the proxy server being able to simultaneously support both RBI and domain name rewriting methods to implement WebVPN, it also determines which method will produce the best presentation effect for the current access request, ensuring that the page is always presented with the best effect, such as... Figure 2 As shown, step 101 includes:
[0036] Step 1011: After returning the first response data to the client browser based on the first access request sent by the client browser, receive the second access request sent by the client browser.
[0037] Step 1012: Determine the target access method based on the feature information of the second access request; the target access method is either RBI or domain name rewriting.
[0038] In this embodiment, the characteristic information of the second access request may include domain name information and / or Uniform Resource Identifier (URI) in the URL. For example, if the domain name information in the URL includes keywords such as video and music, it is determined that the requested webpage is a webpage containing audio and video content, and the domain name rewriting method is better. Therefore, the target access method is determined to be the domain name rewriting method. The target access method corresponds to the access method that can bring the best page presentation effect in the client browser.
[0039] In some examples, the target access method can be determined based on the characteristic information of the second access request in the following ways: Based on the characteristic information of the second access request, determine whether the webpage requested by the second access request contains content that would be affected by pixel push and page reconstruction. If the webpage requested by the second access request contains content that would be affected by pixel push and page reconstruction, the target access method is determined to be domain name rewriting. If the webpage requested by the second access request does not contain content that would be affected by pixel push and page reconstruction, the target access method is determined to be RBI.
[0040] In other examples, the target access method can also be determined based on the characteristic information of the second access request in the following ways: search for the response data corresponding to the characteristic information of the second access request from the recorded response data returned by the origin server based on the access request, determine whether there is an incompatibility problem in the code of the found response data, and determine that the target access method is the domain name rewriting method if there is no incompatibility problem, and determine that the target access method is the RBI method if there is an incompatibility problem.
[0041] Of course, the above is only a specific example of step 1012. In other examples, step 1012 can also be implemented in other ways, which will not be elaborated here.
[0042] Step 1013: Initiate access to the origin server according to the target access method and the second access request.
[0043] In this embodiment, after determining that the target access method is RBI, an access is initiated to the origin server according to the second access request in accordance with the RBI method; after determining that the target access method is domain name rewriting, an access is initiated to the origin server according to the second access request in accordance with the domain name rewriting method.
[0044] To help those skilled in the art better understand the implementation process of step 1013, its implementation in both RBI and domain name rewriting methods will be explained in detail below.
[0045] In some embodiments, the target access method is RBI (Resource By-Access). In this case, the first response data includes resource code data, and the second response data includes pixel stream data. Accordingly, the access method flow is as follows: Figure 3 As shown, it includes:
[0046] Step 1012 is: Based on the feature information of the second access request, determine that the target access method is RBI.
[0047] Step 1013 is as follows: Configure the isolated browser running locally; and use the configured isolated browser to initiate access to the origin server based on the second access request.
[0048] Accordingly, before sending the second response data generated based on the resource code data returned by the origin server to the client browser, the access method also includes:
[0049] Step 103: Receive the resource code data returned by the source server.
[0050] Step 104: Load the page on the isolated browser based on the received resource code data.
[0051] Step 105: Generate pixel stream data based on the loaded page to obtain the second response data.
[0052] In other embodiments, the target access method is a domain name rewriting method. In this case, the first response data includes pixel stream data, and the second response data includes resource code data. Accordingly, the access method flow is as follows: Figure 4 As shown, it includes:
[0053] Step 1012 is: Based on the feature information of the second access request, determine that the target access method is domain name rewriting.
[0054] Step 1013 is: Initiate access to the origin server directly based on the second access request.
[0055] Step 1013 in this embodiment is relative to Figure 3In the illustrated embodiment, step 1013 requires setting up an isolated browser and initiating access through the isolated browser. In this embodiment, "direct" in step 1013 means that no other settings are required. Instead, the domain name information carried in the second access request is used to find the domain name information of the origin site and the actual domain name of the webpage to be accessed. Based on the found domain name information, access can be initiated to the corresponding origin site. For example, based on the URL https: / / C.proxy.com / video carried in the access request sent by the client browser, the origin site domain name www.A.com is found, and www.A.com / video.
[0056] Accordingly, before sending the second response data generated based on the resource code data returned by the origin server to the client browser, the access method also includes:
[0057] Step 106: Receive the resource code data returned by the source server.
[0058] Step 107: Based on the preset correspondence between the real domain name and the proxy domain name, modify the real domain name of the URL in the received resource code data to the corresponding proxy domain name to obtain the second response data.
[0059] In some cases, the pre-defined correspondence between real domain names and proxy domain names can be stored in a data table.
[0060] It should be noted that the access method provided in this application emphasizes that after a first access request initiated to the origin server based on either RBI or domain name rewriting is responded to, a second access request is initiated based on the other of the two methods. This is because relevant data is generated during the response to the first access request, and this data can be used in the process of re-accessing the origin server, thereby simplifying the access process of the second access request. In other words, the aforementioned embodiments implicitly imply that information related to the origin server can be shared between the RBI and domain name rewriting methods. That is, regardless of whether an access is made using RBI or domain name rewriting, the information related to the origin server can be shared to re-access using either method. This achieves flexible and dynamic switching between RBI and domain name rewriting access based on changes in the accessed webpage when accessing the same origin server. For example, after initially accessing an audio / video webpage managed by the origin server using RBI, one can then re-initiate access to a news webpage managed by the origin server using domain name rewriting based on the relevant information obtained from the RBI access, simplifying user verification processes.
[0061] In some embodiments, the sharing of information related to the origin server obtained during the access request response process can be achieved by authorizing the acquisition of information from both the isolated browser and the client browser. Specifically, in the RBI mode, the authorization obtains relevant information from the client browser obtained from the last access to the origin server based on the domain name rewriting method. In the domain name rewriting mode, the authorization obtains relevant information from the isolated browser obtained from the last access to the origin server based on the domain name rewriting method.
[0062] In other embodiments, the relevant information can be uniformly stored in the proxy server. That is, in the domain name rewriting method, the relevant information is no longer stored in the client browser; in the RBI method, the relevant information is no longer stored in the isolated browser. Based on this, as... Figure 5 As shown, prior to step 101, the access method also includes:
[0063] Step 108: Obtain the target verification information generated during the response to the first access request.
[0064] In this embodiment, the verification information includes at least cookie information. In some cases, the verification information also includes storage information in addition to cookie information.
[0065] It's important to note that cookies are generated by the origin server by adding a special instruction to the header of the access request, prompting the browser to follow the instructions, and / or by the client using JavaScript (JS) code. Storage information is a further extension of the data generated during the access process, building upon cookies. Cookie information, or a combination of cookies and storage information, generated during a single access to the origin server is typically used on subsequent visits to the same site to simplify the access process. Therefore, users do not need to initiate login verification again, simplifying the verification process.
[0066] Step 109: Store the target verification information.
[0067] In some cases, proxy servers may also include shared storage space to store target verification information. This can be achieved by storing the target verification information in the shared storage space, thus facilitating unified management of the verification information.
[0068] In addition, target verification information can be stored separately by user, that is, the target verification information of the same user is stored together, which facilitates user management.
[0069] Accordingly, step 101 now includes the following steps:
[0070] Step 1014: After returning the first response data to the client browser based on the first access request sent by the client browser, receive the second access request sent by the client browser.
[0071] Step 1015: Based on the second access request, find the verification information of the access request with the same main domain name as the second access request, and obtain the target verification information.
[0072] It should be noted that having the same main domain name means corresponding to the same origin site. In other words, the verification information found during the access process to the same origin site is used as the target verification information.
[0073] Step 1016: Based on the target verification information and the second access request, initiate an access to the origin server.
[0074] Specifically, the target verification information is appended to the request header of the second access request, and then the second access request is sent to the origin server.
[0075] As mentioned earlier, the storage methods for verification information in RBI and domain name rewriting methods are different. In order to improve compatibility with existing WebVPNs and reduce changes to the access process, in some embodiments, the parsing location of the verification information is not changed, but the verification information is obtained from the corresponding location and stored in the proxy server.
[0076] When the target access method is domain rewriting, the first response data includes resource code data, and the second response data includes pixel stream data. Since the interaction with the webpage actually occurs on the client browser after accessing the origin server using domain rewriting, the target verification information is all on the client browser. This includes: Cookie information in the data header of the response returned by the origin server, Cookies generated by the client browser based on preset JS code, and Storage information generated by the client browser based on preset JS code. Different types of target browsers have different characteristics and can be obtained in different ways. Therefore, in some embodiments, such as... Figure 6 As shown, obtaining the target verification information in the access method, i.e., step 108, includes the following steps:
[0077] Step 1081: Based on the preset API, obtain the target verification information generated during the process of the client browser loading the first response data.
[0078] Step 1082: Obtain the target verification information returned by the source server based on the first response request.
[0079] In this embodiment, since the Cookie information in the data header of the response returned by the origin server is actually transmitted from the origin server to the client browser through the proxy server, it is obtained from the interaction information recorded by the proxy program configured in the client browser. However, the Cookie and Storage information generated by the client browser based on the preset JS code are generated by the client browser itself. Therefore, they need to be obtained and sent back to the proxy server through the relevant Application Programming Interface (API) that encapsulates the JS code.
[0080] When the target access method is RBI, the first response data includes pixel stream data, and the second response data includes resource code data. Since the interaction with the webpage actually occurs on an isolated browser after accessing the origin server via RBI, all target verification information resides on this isolated browser. Furthermore, in some embodiments, such as... Figure 7 As shown, obtaining the target verification information in the access method, i.e., step 108, includes the following steps:
[0081] Step 1083: Based on the browser interface protocol, obtain the target verification information from the response returned by the origin server based on the first access request received by the isolated browser.
[0082] In this embodiment, since the target verification information to be obtained is located in the isolated browser, the target verification information can be obtained through the interface set by the browser's interface protocol. Among them, storage information can be obtained through the localStorage.getItem interface and the localStorage.setItem interface, and cookie information can be obtained through the Network.getCookies interface and the Network.setCookies interface.
[0083] It should be noted that, under the RBI method, as shown in the aforementioned embodiment, when the proxy server initiates access to the origin server, it does so through an isolated browser. Before initiating access, the isolated browser also needs to be configured. Similar to this embodiment, the configuration of the isolated browser can also be implemented based on the browser interface protocol, that is, the cookie information saved in the last domain name rewrite method, or the cookie information + storage information are set into the isolated browser through the corresponding interface mentioned above. These will not be elaborated on here.
[0084] It is understandable that an access request based on the first access request had already been initiated before the second access request was initiated. Therefore, the second access request is not the first access to the origin server, but the first access request can be the first access to the origin server. When the first access request is the first access to the origin server, it requires the user to log in for verification. In this case, such as Figure 8 As shown, prior to step 1083, the access method also includes:
[0085] Step 110: After the client browser receives the first response data, receive the login request sent by the client browser.
[0086] Step 111: Send the login request to the origin server through the isolated browser.
[0087] Step 112: By isolating the browser, generate a callback event based on the response of the login request returned by the origin server.
[0088] Accordingly, step 1083 is: based on the browser interface protocol, obtain the target verification information carried in the callback event from the isolated browser.
[0089] To help those skilled in the art better understand the access method provided in the above embodiments, the following will illustrate the method by taking an initial access to a source site using RBI and a second access to the source site C using domain name rewriting.
[0090] The client browser sends an initial access request to the proxy server. Upon receiving this request, the proxy server determines the target access method as RBI based on its characteristics. Next, the proxy server forwards the request to the origin server C via its locally running isolated browser. Origin server C responds to the request, generating initial resource code data and returning it to the proxy server. The proxy server then loads this resource code data into the isolated browser, generating pixel stream data. Simultaneously, it returns the pixel stream data to the client browser and stores the verification information generated during page loading in the CommonDB database component. CommonDB is a pre-defined shared storage space within the proxy server used to store verification information. The client then reconstructs the webpage based on the received pixel stream data, allowing the user to view the webpage in their browser. For a better experience, the user logs in by entering relevant information. At this point, the client browser sends a login request to the proxy server based on the user's input on the pixel stream-reconstructed webpage. The proxy server forwards login requests to the origin server by isolating the browser. The origin server verifies the login information based on the login details. If the verification passes, it returns a login response to the proxy server. The proxy server generates a corresponding callback event based on the received login response and stores the verification information in the CommonDB database component. Finally, the client browser receives the response from the callback event.
[0091] Next, the user clicks on a link in the client browser pointing to an audio / video webpage. The client browser then sends a second access request to the proxy server. Upon receiving the second access request, the proxy server, based on its characteristics, determines that the target access method is domain rewriting. Furthermore, the proxy server retrieves the corresponding verification information from the CommonDB database component based on the second access request, obtaining the verification information saved during the response to the first access request. This verification information is then appended to the header of the second access request before being sent to the origin server. The origin server responds to the second access request, generating second resource code data and returning it to the proxy server. The origin server also performs verification using the verification information carried in the second access request; that is, the page loaded after the second resource code data is the verified page. Upon receiving the second resource code data, the proxy server, according to the pre-defined mapping relationship between the real domain name and the proxy domain name recorded in the data table, replaces the real domain name in the second resource code data with the proxy domain name, obtaining third resource code data. This third resource code data is then returned to the client browser, allowing the client browser to load the verified webpage based on it.
[0092] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.
[0093] Another aspect of this application embodiment also provides a proxy server, such as Figure 9 As shown, it includes:
[0094] The first processing module 903 is used to receive a second access request sent by the client browser after returning a first response data to the client browser based on the first access request sent by the client browser, and to initiate access to the origin site according to the second access request. The URLs carried by the first access request and the second access request have the same main domain name.
[0095] The second processing module 902 is used to send the second response data generated based on the resource code data returned by the origin server to the client browser. The first response data includes one of the resource code data and the pixel stream data, and the second response data includes the other of the resource code data and the pixel stream data.
[0096] It should be noted that all the modules mentioned above are logical modules. The first processing module 901 and the second processing module 902 are respectively composed of a proxy gateway, a domain name rewriting module, an RBI controller, and an isolated browser, or a part of a module. The proxy gateway is used to interact directly with the client browser. Therefore, receiving access requests and returning response data to the client browser are both implemented by the proxy gateway. It also interacts with the domain name rewriting module and the RBI controller to receive response data from access requests from the domain name rewriting module and / or the RBI controller, and to transmit access requests from the client browser to the domain name rewriting module and / or the RBI controller. The domain name rewriting module participates in the interaction between the proxy server and the origin server in the domain name rewriting mode. The RBI controller and the isolated browser mainly participate in the processing of the proxy server in the RBI mode. The RBI controller mainly interacts internally, while the isolated browser mainly interacts directly with the origin server externally. In addition, the proxy server may include a database component to facilitate the maintenance of verification information. The database component should not only participate in the process of initiating access to the origin server and providing verification information to the domain name rewriting module and RBI controller, but also participate in the response process to receive and store the verification information from the domain name rewriting module and RBI controller.
[0097] It is not difficult to see that this embodiment is a server embodiment corresponding to the method embodiment, and this embodiment can be implemented in conjunction with the method embodiment. The relevant technical details mentioned in the method embodiment are still valid in this embodiment, and will not be repeated here to reduce repetition. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the method embodiment.
[0098] It is worth mentioning that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed in this application; however, this does not mean that other units are absent in this embodiment.
[0099] Another aspect of this application embodiment also provides an electronic device, such as... Figure 10 As shown, it includes: at least one processor 1001; and a memory 1002 communicatively connected to at least one processor 1001; wherein the memory 1002 stores instructions executable by at least one processor 1001, the instructions being executed by at least one processor 1001 to enable at least one processor 1001 to perform the access method described in any of the above method embodiments.
[0100] The memory 1002 and processor 1001 are connected via a bus. This bus can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors 1001 and memory 1002. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by processor 1001 is transmitted over a wireless medium via an antenna, which further receives data and transmits it to processor 1001.
[0101] Processor 1001 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory 1002 can be used to store data used by processor 1001 during operation.
[0102] Another aspect of this application provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the access method described in any of the above method embodiments.
[0103] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0104] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.
Claims
1. An access method, characterized in that, Applied to a proxy server, the method includes: After returning the first response data to the client browser based on the first access request sent by the client browser, the system receives the second access request sent by the client browser and determines the target access method based on the feature information of the second access request. The target access method is either Remote Browser Isolation (RBI) or Domain Name Rewriting. According to the target access method, an access is initiated to the origin site based on the second access request, and the URLs carried by the first access request and the second access request have the same main domain name; The second response data generated based on the resource code data returned by the source site is sent to the client browser, so that when the webpage is accessed in the RBI mode for the best page presentation effect, it can be accessed in the RBI mode, and when the webpage is accessed in the domain name rewriting mode for the best page presentation effect, it can be accessed in the domain name rewriting mode. The first response data includes one of resource code data and pixel stream data, and the second response data includes the other of resource code data and pixel stream data.
2. The access method according to claim 1, characterized in that, Before receiving the second access request sent by the client browser, the method further includes: Obtain the target verification information generated during the response to the first access request; Store the target verification information.
3. The access method according to claim 2, characterized in that, The step of initiating access to the origin server based on the second access request includes: Based on the second access request, find the verification information of the access request with the same main domain as the second access request, and obtain the target verification information; Based on the target verification information and the second access request, an access is initiated to the source site.
4. The access method according to claim 2, characterized in that, The first response data includes resource code data, and the second response data includes pixel stream data. The step of obtaining the target verification information generated during the response to the first access request includes: Based on a preset API, obtain the target verification information generated during the process of the client browser loading the first response data; Obtain the target verification information returned by the source station based on the first response request.
5. The access method according to claim 2, characterized in that, The first response data includes pixel stream data, and the second response data includes resource code data. The step of obtaining the target verification information generated during the response to the first access request includes: Based on the browser interface protocol, the target verification information is obtained from the response returned by the origin server based on the first access request received by the isolated browser.
6. The access method according to claim 5, characterized in that, Before obtaining the target verification information from the response returned by the origin server based on the first access request received by the isolated browser based on the browser interface protocol, the method further includes: After the client browser receives the first response data, the client browser sends a login request. The login request is sent to the origin server via an isolated browser; By isolating the browser, a callback event is generated based on the response to the login request returned by the origin server; The step of obtaining the target verification information from the response returned by the origin server based on the first access request, received from the isolated browser based on the browser interface protocol, includes: Based on the browser interface protocol, the target verification information carried in the callback event is obtained from the isolated browser.
7. The access method according to any one of claims 2 to 6, characterized in that, The proxy server includes shared storage space, and the storage of the target verification information includes: The target verification information is stored in the shared storage space.
8. The access method according to claim 1, characterized in that, The target access method is RBI, the first response data includes resource code data, and the second response data includes pixel stream data. The step of initiating access to the origin server based on the second access request includes: Configure the isolated browser running locally; Using the configured isolated browser, an access request is initiated to the origin server based on the second access request. Before sending the second response data generated based on the resource code data returned by the origin server to the client browser, the method further includes: Receive resource code data returned by the source station; Load the page in the isolated browser based on the received resource code data; The second response data is obtained by generating pixel stream data based on the loaded page.
9. The access method according to claim 1, characterized in that, The target access method is domain name rewriting. The first response data includes pixel stream data, and the second response data includes resource code data. The step of initiating access to the origin server based on the second access request includes: Initiate access directly to the origin server based on the second access request; Before sending the second response data generated based on the resource code data returned by the origin server to the client browser, the method further includes: Receive resource code data returned by the source station; Based on the preset correspondence between the real domain name and the proxy domain name, the real domain name of the URL in the received resource code data is modified to the corresponding proxy domain name to obtain the second response data.
10. A proxy server, characterized in that, include: The first processing module is configured to, after returning first response data to the client browser based on the first access request sent by the client browser, receive a second access request sent by the client browser, determine the target access method based on the feature information of the second access request, wherein the target access method is either Remote Browser Isolation (RBI) or Domain Name Rewriting (DNR); and, according to the target access method, initiate access to the origin server based on the second access request, wherein the URLs carried by the first access request and the second access request have the same main domain name. The second processing module is used to send the second response data generated based on the resource code data returned by the origin server to the client browser, so that when the webpage is accessed in RBI mode for the best page presentation effect, it can be accessed in RBI mode, and when the webpage is accessed in domain name rewriting mode for the best page presentation effect, it can be accessed in domain name rewriting mode; the first response data includes one of resource code data and pixel stream data, and the second response data includes the other of resource code data and pixel stream data.
11. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the access method as described in any one of claims 1 to 9.
12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the access method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Resource access method and server
CN108965203A
Inline file download controls in remote browser isolation system
US20220188438A1