TW201735583A - File calling method and apparatus - Google Patents

File calling method and apparatus Download PDF

Info

Publication number
TW201735583A
TW201735583A TW106102210A TW106102210A TW201735583A TW 201735583 A TW201735583 A TW 201735583A TW 106102210 A TW106102210 A TW 106102210A TW 106102210 A TW106102210 A TW 106102210A TW 201735583 A TW201735583 A TW 201735583A
Authority
TW
Taiwan
Prior art keywords
resource file
debugged
file
virtual server
access path
Prior art date
Application number
TW106102210A
Other languages
Chinese (zh)
Other versions
TWI672019B (en
Inventor
zhi-hao Gu
Original Assignee
Alibaba Group Services Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Services Ltd filed Critical Alibaba Group Services Ltd
Publication of TW201735583A publication Critical patent/TW201735583A/en
Application granted granted Critical
Publication of TWI672019B publication Critical patent/TWI672019B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Embodiments of the application provide a file calling method and apparatus. The method comprises: when a replacement instruction for a network resource file on an HTTPS webpage is received, establishing a virtual server locally according to the replacement instruction; replacing, via the virtual server, an access path for accessing the network resource file with an access path for accessing a local resource file to be debugged; and then generating a root certificate and a child certificate for the virtual server, so that when a local browser initiates a calling request for the network resource file according to the https webpage, the virtual server receives the calling request, and returns the resource file to be debugged and the child certificate to the browser, and the browser calls and executes, according to the child certificate, the resource file to be debugged. According to the method of the invention, a virtual server can generate root certificates and child certificates for provision to a browser, such that the browser can call resource files for debugging in a normal way.

Description

調用文件之方法與裝置 Method and device for calling a file

本發明係關於資訊技術領域,尤其關於一種調用文件方法及裝置。 The present invention relates to the field of information technology, and more particularly to a method and apparatus for calling a file.

在現今的資訊化社會中,網路成為人們生活和工作中不可或缺的一部分。人們在瀏覽網頁時,一般是通過瀏覽器(或者,具有瀏覽器內核的應用)與伺服器建立通信連接,以使得該瀏覽器可向該伺服器發送獲取網頁頁面的請求,並在獲得該伺服器返回的網頁頁面後,顯示該網頁頁面。 In today's information society, the Internet has become an indispensable part of people's lives and work. When browsing a webpage, a person generally establishes a communication connection with a server through a browser (or an application having a browser kernel), so that the browser can send a request for obtaining a webpage page to the server, and obtain the servo. After the page page returned by the device, the page page is displayed.

由於,網頁是由一組代碼構成的(如,由html5代碼構成),並且該網頁的代碼指向各類資源文件(如,JavaScript程式源文件、網頁的樣式文件等)也是由各自的代碼構成的,但是代碼都是人工編寫的,所以只要是代碼就可能會存在缺陷或者瑕疵。於是,在伺服器向網路提供一個網頁之前(即,將一個網頁上線之前),一般會在離線環境中,先對該網頁中的各個代碼進行測試,即,進行離線測試。 Because the web page is composed of a set of code (for example, composed of html5 code), and the code of the web page points to various resource files (for example, a JavaScript program source file, a web page style file, etc.) is also composed of respective codes. , but the code is written manually, so as long as it is the code, there may be defects or flaws. Therefore, before the server provides a webpage to the network (that is, before a webpage is put online), generally, in the offline environment, each code in the webpage is tested first, that is, offline test.

但是,在離線測試時,該伺服器只能使用模擬的線上資料對該網頁進行測試,這就使得離線測試的結果並不一定準確,也就是說通過離線測試確定沒有問題的網頁,在上線後也可能出現問題。則此時,工作人員需要在伺服器端調試該出現問題的資源文件的代碼,但是由於伺服器一般比較繁忙,在該伺服器中執行該調試操作的業務可能需要排隊等待,直到有空閒線程來執行該調試操作業務,所以導致每一次調試該出現問題的資源文件的代碼所需要的時間較長。並且,由於通常情況下僅靠一次調試很難解決該資源文件的代碼中存在的問題,需要進行多次調試,所以進一步使得調試解決問題所需的時間增加(尤其是在對儲存於其他伺服器中的資源文件進行調試時,還需要浪費大量的傳輸時間)。基於上述原因,導致工作人員難以對網頁中出現問題的資源文件進行快速、方便的調試。 However, in the offline test, the server can only use the simulated online data to test the webpage, which makes the offline test result not necessarily accurate, that is, the offline test determines the webpage without problems, after going online There may also be problems. At this time, the staff needs to debug the code of the resource file in question on the server side, but since the server is generally busy, the service performing the debugging operation in the server may need to wait in line until there is an idle thread. The debug operation is performed, so it takes a long time to debug the code of the resource file that has the problem each time. Moreover, since it is difficult to solve the problem in the code of the resource file by one debugging in a normal situation, it is necessary to perform multiple debugging, so the time required for debugging to solve the problem is further increased (especially when the pair is stored in other servers). When debugging resource files in the middle, it also needs to waste a lot of transfer time). For the above reasons, it is difficult for the staff to quickly and conveniently debug the resource files that have problems in the webpage.

於是,在現有技術中,針對網頁中需要調試的資源文件,採用http代理的方法,將需要調試的資源文件映射到終端本地,以便後續可以利用真實的線上資料,對該資源文件進行調試,其中,http代理方法具體如圖1所示。 Therefore, in the prior art, the resource file that needs to be debugged in the webpage is mapped to the terminal by using the http proxy method, so that the resource file can be debugged by using the real online data. The http proxy method is shown in Figure 1.

圖1為現有技術http代理的方法,具體包括:S101:確定網頁中需要調試的資源文件,並下載所述資源文件,作為待調試資源文件。 FIG. 1 is a method of a prior art http proxy, specifically including: S101: determining a resource file that needs to be debugged in a webpage, and downloading the resource file as a resource file to be debugged.

由於http代理方法,是希望工作人員可以在終端本地完成對該資源文件的調試,所以首先該端需要確定網頁中需要調試的資源文件,再將該文件下載到該終端本地,作 為待調試資源文件,以便後續可以對該待調試資源文件進行調試。 Because of the http proxy method, it is hoped that the staff can complete the debugging of the resource file locally in the terminal, so firstly, the end needs to determine the resource file that needs to be debugged in the webpage, and then download the file to the terminal locally. The resource file to be debugged so that the resource file to be debugged can be debugged later.

S102:建立虛擬伺服器,並為該待調試資源文件確定存取路徑。 S102: Establish a virtual server, and determine an access path for the resource file to be debugged.

該待調試資源文件需要通過本地瀏覽器獲取。具體的,該瀏覽器通過運行網頁中的代碼,先獲得該待調試資源文件的存取路徑(即,該待調試資源文件的域名),再根據所述存取路徑,向提供該待調試資源文件的伺服器發起調用該資源文件的請求,最後獲得該伺服器返回的該待調試資源文件。 The resource file to be debugged needs to be obtained through a local browser. Specifically, the browser obtains the access path of the resource file to be debugged (that is, the domain name of the resource file to be debugged) by running the code in the webpage, and then provides the resource to be debugged according to the access path. The server of the file initiates a request to invoke the resource file, and finally obtains the resource file to be debugged returned by the server.

但是,由於工作人員希望能通過在本地直接修改該待調試資源文件,所以此時,該終端還需要偽裝成為伺服器,以欺騙該瀏覽器,讓該瀏覽器通過運行同樣的網頁代碼,獲取本地已下載的該待調試資源文件。以實現,在該終端本地調試該待調試資源文件的目的。 However, since the staff wants to directly modify the resource file to be debugged locally, at this time, the terminal also needs to be disguised as a server to deceive the browser, so that the browser obtains the local by running the same webpage code. The resource file to be debugged that has been downloaded. To achieve the purpose of debugging the resource file to be debugged locally on the terminal.

具體的,該終端需要在本地建立虛擬伺服器,並為儲存在本地的該待調試資源文件確定存取路徑(即,該待調試資源文件的虛擬域名)。 Specifically, the terminal needs to establish a virtual server locally, and determine an access path (that is, a virtual domain name of the resource file to be debugged) for the resource file to be debugged stored locally.

S103:通過所述虛擬伺服器,將存取原資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。 S103: Replace, by the virtual server, an access path for accessing the original resource file to an access path for accessing the local resource file to be debugged.

為了使該終端中的瀏覽器在通過網頁代碼存取該資源文件時,不再存取該資源文件的伺服器,而是存取本地的虛擬伺服器。此時,還需要對該終端的網路配置進行修改,以使得該終端在接收到該瀏覽器發起的調用該資源文 件的請求時,將存取該資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。 In order to enable the browser in the terminal to access the resource file through the webpage code, the server of the resource file is no longer accessed, but the local virtual server is accessed. At this time, the network configuration of the terminal needs to be modified, so that the terminal receives the resource message initiated by the browser. When the request is made, the access path for accessing the resource file is replaced with the access path for accessing the local resource file to be debugged.

使得當該瀏覽器向網路上的伺服器發送調用該資源文件的請求時,該虛擬伺服器替代該網路上的伺服器接收該調用請求,並將該待調試資源文件返回給該伺服器,並使該瀏覽器確定接收到的是網路上對應伺服器返回的資源文件。 When the browser sends a request to the server on the network to invoke the resource file, the virtual server replaces the server on the network to receive the call request, and returns the resource file to be debugged to the server, and Let the browser determine that the resource file returned by the corresponding server on the network is received.

通過圖1所述的方法,可將該需要調試的資源文件下載到本地後,作為待調試資源文件,在該終端本地對該待調試資源文件經行調試,並且由於該網頁中代碼並沒有改動,所以可以充分的利用線上的真實資料進行調試。進一步的,由於該終端可僅用於調試該待調試資源文件,所以每一次調試過程無需等待可以立刻執行,提高了調試效率。 After the resource file to be debugged is downloaded to the local device as the resource file to be debugged, the resource file to be debugged is debugged locally on the terminal, and the code in the webpage is not changed. So you can make full use of the real data on the line for debugging. Further, since the terminal can be used only for debugging the resource file to be debugged, each debugging process can be executed immediately without waiting, which improves debugging efficiency.

但是,圖1所示的過程僅可針對網頁為超文本傳輸協議(Hyper Text Transfer Protocol,http)的網頁實現。對於網頁為安全套接字層超文本傳輸協議(Hyper Text Transfer Protocol over Secure Socket Layer,https)的網頁而言,此時瀏覽器與伺服器間的傳輸需要進行通信加密,即,該瀏覽器需要利用安全套接字層協議(Secure Socket Layer,ssl)協議產生的安全證書來驗證伺服器的身份,並在接收伺服器返回的資源文件時,需要驗證該資源文件是否攜帶了對應的安全證書。 However, the process shown in FIG. 1 can only be implemented for a web page whose web page is a Hyper Text Transfer Protocol (http). For a webpage whose webpage is a Hyper Text Transfer Protocol over Secure Socket Layer (https), the transmission between the browser and the server needs to be encrypted by communication, that is, the browser needs The security certificate generated by the Secure Socket Layer (Ssl) protocol is used to verify the identity of the server, and when receiving the resource file returned by the server, it is necessary to verify whether the resource file carries the corresponding security certificate.

但是,由於在圖1所示的過程中,該虛擬伺服器沒有 安全證書,也無法提供安全證書,則該瀏覽器既無法驗證該虛擬伺服器的身份,也無法確定接收到該虛擬伺服器返回的該待調試資源文件的安全性,那麼對於https網頁來說,該瀏覽器甚至無法調用該待調試資源文件,也就使得工作人員無法進行後續調試工作。 However, due to the process shown in Figure 1, the virtual server does not have If the security certificate cannot provide a security certificate, the browser cannot verify the identity of the virtual server, nor can it determine the security of the resource file to be debugged returned by the virtual server. For the https webpage, The browser cannot even call the resource file to be debugged, which makes the staff unable to perform subsequent debugging work.

可見,現有技術中,由於沒有安全證書,導致難以進行https網頁的代理,無法調用待調試資源文件的問題。 It can be seen that in the prior art, since there is no security certificate, it is difficult to perform proxying of the https webpage, and the problem of the resource file to be debugged cannot be called.

本發明實施例提供一種調用文件方法及裝置,用以解決現有調用文件方法,採用的http代理方式,由於無法提供安全證書,導致瀏覽器無法調用待調試資源文件的問題。 The embodiment of the present invention provides a method and a device for calling a file, which are used to solve the problem that the existing proxy file method and the http proxy method are used, and the browser cannot be used to debug the resource file to be debugged because the security certificate cannot be provided.

本發明實施例提供的一種調用文件方法,包括:接收針對https網頁中網路資源文件的替換指令;根據所述替換指令,在本地建立虛擬伺服器;通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑;為所述虛擬伺服器產生根證書;根據所述根證書,產生子證書,使得當本地瀏覽器根據所述https網頁發起對所述網路資源文件的調用請求時,由所述虛擬伺服器接收到所述調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向所述瀏覽器返回所述待調試資源文件以及所述子證書,使所述瀏覽器根 據所述子證書,獲取並執行所述待調試資源文件。 A method for invoking a file according to an embodiment of the present invention includes: receiving a replacement instruction for a network resource file in a https webpage; establishing a virtual server locally according to the replacement instruction; and accessing the access server by using the virtual server The access path of the network resource file is replaced with an access path for accessing the local resource file to be debugged; a root certificate is generated for the virtual server; and the sub-certificate is generated according to the root certificate, so that when the local browser is When the https webpage initiates a call request to the network resource file, the virtual server receives the call request, and according to the access path that is replaced by accessing the local resource file to be debugged, to the browser Returning the resource file to be debugged and the sub-certificate to make the browser root According to the sub-certificate, the resource file to be debugged is acquired and executed.

本發明實施例提供的一種調用文件裝置,包括:接收模組,用於接收https網頁中網路資源文件的替換指令;執行模組,用於根據所述替換指令,在本地建立虛擬伺服器;替換模組,用於通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑;根證書模組,用於為所述虛擬伺服器產生根證書;子證書模組,用於根據所述根證書,產生子證書,使得當本地瀏覽器根據所述https網頁發起對所述網路資源文件的調用請求時,由所述虛擬伺服器接收到所述調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向所述瀏覽器返回所述待調試資源文件以及所述子證書,使所述瀏覽器根據所述子證書,獲取並執行所述待調試資源文件。 The embodiment of the present invention provides a call file device, comprising: a receiving module, configured to receive a replacement instruction of a network resource file in a https webpage; and an execution module, configured to establish a virtual server locally according to the replacement instruction; a replacement module, configured to replace, by the virtual server, an access path for accessing the network resource file with an access path for accessing a local resource file to be debugged; a root certificate module, configured to The virtual server generates a root certificate, and the sub-certificate module is configured to generate a sub-certificate according to the root certificate, so that when the local browser initiates a call request for the network resource file according to the https webpage, Receiving, by the virtual server, the call request, and returning the to-be-debuved resource file and the sub-certificate to the browser according to an access path replaced with accessing the local to-be-debug resource file, so that the browser is configured according to the browser The sub-certificate acquires and executes the resource file to be debugged.

本發明實施例提供一種調用文件方法及裝置,該方法當接收到針對https網頁中網路資源文件的替換指令時,根據該替換指令,在本地建立虛擬伺服器,並通過該虛擬伺服器,將存取該網路資源文件的存取路徑替換為存取本地的待調試資源文件的存取路徑,之後為該虛擬伺服器產生根證書以及子證書,使得當本地瀏覽器根據http網頁發起對該網路資源文件的調用請求時,由該虛擬伺服器接收 該調用請求,並向該瀏覽器返回該待調試資源文件以及該子證書,最終使得該瀏覽器可以根據該子證書,調用並執行該待調試資源文件。通過上述方法,由於為虛擬伺服器產生了根證書以及對應的子證書,使得該虛擬伺服器可向該瀏覽器提供安全證書,使該瀏覽器可正常調用該待調試資源文件。 An embodiment of the present invention provides a method and an apparatus for calling a file. When receiving a replacement instruction for a network resource file in a https webpage, the method establishes a virtual server locally according to the replacement instruction, and uses the virtual server to Accessing the access path of the network resource file is replaced by accessing the access path of the local resource file to be debugged, and then generating a root certificate and a sub-certificate for the virtual server, so that the local browser initiates the Received by the virtual server when a request for a network resource file is invoked The calling request returns the resource file to be debugged and the sub-certificate to the browser, and finally enables the browser to call and execute the resource file to be debugged according to the sub-certificate. Through the above method, since the root certificate and the corresponding sub-certificate are generated for the virtual server, the virtual server can provide the browser with a security certificate, so that the browser can call the resource file to be debugged normally.

301‧‧‧接收模組 301‧‧‧ receiving module

302‧‧‧執行模組 302‧‧‧Execution module

303‧‧‧替換模組 303‧‧‧Replacement module

304‧‧‧根證書模組 304‧‧‧ Root Certificate Module

305‧‧‧子證書模組 305‧‧‧Sub-certificate module

306‧‧‧下載模組 306‧‧‧Download module

此處所說明的附圖用來提供對本發明的進一步理解,構成本發明的一部分,本發明的示意性實施例及其說明用於解釋本發明,並不構成對本發明的不當限定。在附圖中:圖1為現有技術http代理過程;圖2為本發明實施例提供的調用文件過程;圖3是本發明實施例提供一種調用文件裝置的結構示意圖。 The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawings: FIG. 1 is a prior art http proxy process; FIG. 2 is a call file process according to an embodiment of the present invention; FIG. 3 is a schematic structural diagram of a call file device according to an embodiment of the present invention.

在本發明實施例中,在接收到對https網頁中的網路資源的替換指令時,該終端先根據該指令,先在該終端本地建立虛擬伺服器,再通過該虛擬伺服器,將該終端中存取該網路資源文件的存取路徑替換為存取本地的待調試資源文件的存取路徑,最後為該虛擬伺服器產生根證書以及對應的子證書。可見本發明所述的方法,通過為該虛擬伺 服器產生根證書(即,該虛擬伺服器頒發的自簽證書)的方法,使得該虛擬伺服器可以欺騙該瀏覽器,使該瀏覽器確定該虛擬伺服器是提供https網頁中網路資源文件的伺服器,並且,當向該瀏覽器返回本地的待調試資源文件時,可以一併返回由該根證書產生的子證書,使得該瀏覽器確定該待調試資源文件是安全的文件,最終使得該瀏覽器可以調用並執行該待調試資源文件,解決了由於虛擬伺服器無法提供安全證書,導致難以進行https網頁的代理,無法調用待調試資源文件的問題。 In the embodiment of the present invention, when receiving the replacement instruction for the network resource in the https webpage, the terminal first establishes a virtual server locally on the terminal according to the instruction, and then uses the virtual server to connect the terminal. The access path for accessing the network resource file is replaced with an access path for accessing the local resource file to be debugged, and finally the root certificate and the corresponding sub-certificate are generated for the virtual server. The method of the present invention can be seen by using the virtual servo The server generates a root certificate (ie, a self-signed certificate issued by the virtual server), so that the virtual server can spoof the browser, so that the browser determines that the virtual server is providing a network resource file in the https webpage. The server, and when returning the local resource file to be debugged to the browser, the sub-certificate generated by the root certificate may be returned together, so that the browser determines that the resource file to be debugged is a secure file, and finally The browser can call and execute the resource file to be debugged, and solves the problem that the virtual server cannot provide the security certificate, which makes it difficult to perform the proxy of the https webpage and cannot call the resource file to be debugged.

為使本發明的目的、技術方案和優點更加清楚,下面將結合本發明具體實施例及相應的附圖對本發明技術方案進行清楚、完整地描述。顯然,所描述的實施例僅是本發明一部分實施例,而不是全部的實施例。基於本發明中的實施例,本領域習知技術人員在沒有做出具有進步性創作之前提下所獲得的所有其他實施例,都屬本發明保護的範圍。 The technical solutions of the present invention will be clearly and completely described in conjunction with the specific embodiments of the present invention and the accompanying drawings. It is apparent that the described embodiments are only a part of the embodiments of the invention, and not all of the embodiments. Based on the embodiments of the present invention, it is within the scope of the present invention to provide all other embodiments obtained by those skilled in the art without making a progressive creation.

圖2為本發明實施例提供的調用文件過程,具體包括以下步驟:S201:接收針對https網頁中網路資源文件的替換指令。 2 is a process for invoking a file according to an embodiment of the present invention, which specifically includes the following steps: S201: Receive a replacement instruction for a network resource file in a https webpage.

由於需要在終端本地對https網頁中的網路資源文件進行調試,所以在調試開始之前,需要先將本地的待調試資源文件替換為該https網頁中的該網路資源文件。但是,由於此時尚未開始對該待調試資源文件的調試,所以 當前的該待調試資源文件可以是任意文件,並可是僅僅擁有文件標識以及地址但是沒有相應的內容的文件(即,是一個空白的文件),並不妨礙後續該待調試資源文件被調用。 The network resource file in the https web page needs to be debugged locally. Therefore, before the debugging starts, the local resource file to be debugged needs to be replaced with the network resource file in the https web page. However, since the debugging of the resource file to be debugged has not started yet, The current resource file to be debugged may be any file, and may be a file that only has the file identifier and the address but has no corresponding content (ie, is a blank file), and does not prevent the subsequent resource file to be debugged from being called.

於是,在本發明實施例中,該終端可接收針對https網頁中的該網路資源文件的替換指令。 Therefore, in the embodiment of the present invention, the terminal may receive a replacement instruction for the network resource file in the https webpage.

具體的,該替換指令可以是一行命令行,用於使該終端確定需要替換的網路資源文件以及預先保存在本地的待調試資源文件。其中,該替換指令包含:該網路資源文件的標識、該網路資源文件的存取路徑、預先保存在本地的該待調試資源文件的標識及該待調試資源文件的地址。 Specifically, the replacement instruction may be a line of command lines for the terminal to determine a network resource file that needs to be replaced and a resource file to be debugged that is saved in advance. The replacement instruction includes: an identifier of the network resource file, an access path of the network resource file, an identifier of the to-be-debug resource file saved in advance, and an address of the resource file to be debugged.

需要說明的是,該終端可以是個人電腦(personal computer,PC)、手機、平板電腦等,該網路資源文件可以是在瀏覽器上運行的java腳本語言(JavaScript,JS)程式源文件、層疊樣式表(Cascading Style Sheets,css)文件等可由伺服器通過統一資源定位符(Uniform Resource Locator,URL)提供的文件。 It should be noted that the terminal may be a personal computer (PC), a mobile phone, a tablet computer, etc., and the network resource file may be a javascript language (JavaScript, JS) program source file running on a browser, and cascading. A Cascading Style Sheets (css) file or the like can be provided by a server through a Uniform Resource Locator (URL).

例如,假設https網頁A中的音樂播放按鈕,在被點擊後會向瀏覽器返回用於調用本地播放器應用播放音頻文件的JS程式源文件(以下,簡稱音頻JS文件),使該https網頁A通過本地播放器應用播放指定的音頻文件,但是工作人員在該https網頁A上線運行後,發現該音樂播放按鈕在點擊後,該https網頁A並沒有播放音頻文件,於是,該工作人員需要在自己的PC上對該https網 頁A中出現問題的該JS程式源文件。 For example, suppose that the music play button in the https webpage A returns a JS program source file (hereinafter referred to as an audio JS file) for calling the local player application to play the audio file after being clicked, so that the https webpage A The specified audio file is played by the local player application, but after the staff runs online on the https webpage A, it is found that after the music play button is clicked, the https webpage A does not play the audio file, so the staff member needs to be in himself. PC on the https network The JS program source file that has a problem in page A.

進一步假設,該PC接收到了針對該https網頁A中的音頻JS文件(即,網路資源文件)的替換指令,並且該替換指令中包含,該音頻JS文件的標識:a.js、該音頻JS文件的存取路徑:https://www.XX.com/XX/a.js、該PC本地預先保存的待調試資源文件的標識:b.js以及該待調試資源文件的地址:E:\調試工作\待調試文件\b.js。 Further suppose that the PC receives a replacement instruction for the audio JS file (ie, the network resource file) in the https webpage A, and the replacement instruction includes the identifier of the audio JS file: a.js, the audio JS File access path: https://www.XX.com/XX/a.js, the ID of the resource file to be debugged locally saved by the PC: b.js and the address of the resource file to be debugged: E:\ Debug work\to be debugged file\b.js.

S202:根據所述替換指令,在本地建立虛擬伺服器。 S202: Establish a virtual server locally according to the replacement instruction.

在本發明實施例中,正常情況下該網路資源文件的調用過程是:該終端中的瀏覽器通過運行該https網頁的代碼,先確定需要調用的網路資源文件的存取路徑,再向儲存該網路資源文件的伺服器發起調用該網路資源文件的請求(即,根據該網路資源文件的存取路徑發起調用請求),最後該瀏覽器接收該伺服器返回的該網路資源文件以及該伺服器提供的子證書,完成對該網路資源文件的調用。 In the embodiment of the present invention, the calling process of the network resource file is normally: the browser in the terminal first determines the access path of the network resource file to be called by running the code of the https webpage, and then The server storing the network resource file initiates a request to invoke the network resource file (ie, initiates a call request according to an access path of the network resource file), and finally the browser receives the network resource returned by the server. The file and the sub-certificate provided by the server complete the call to the network resource file.

但是在本發明中,由於需要該瀏覽器能調用本地的該待調試資源文件(以便後續可以在該終端本地進行調試),所以還需要為該待調試資源文件提供一個該瀏覽器可以存取的存取路徑。於是在本發明中,需要先將該終端偽裝成儲存該帶調試資源文件的虛擬伺服器,並確定該虛擬伺服器的域名,使得該瀏覽器可以通過該虛擬伺服器的域名存取該虛擬伺服器,以便進行後續為該待調試資源文件產生存取路徑。 However, in the present invention, since the browser needs to call the local resource file to be debugged (so that it can be debugged locally in the terminal), it is also necessary to provide the browser resource to be debugged with a browser accessible. Access path. Therefore, in the present invention, the terminal needs to be pretending to store the virtual server with the debug resource file, and the domain name of the virtual server is determined, so that the browser can access the virtual servo through the domain name of the virtual server. In order to subsequently generate an access path for the resource file to be debugged.

具體的在該終端本地建立虛擬伺服器的過程與現有技術一致,通過建立該虛擬伺服器以及確定該虛擬伺服器域名,使得該終端中的瀏覽器可以通過該虛擬伺服器的域名存取建立在該終端本地的虛擬伺服器,為該瀏覽器調用保存在本地的該待調試資源文件建立了基礎。 Specifically, the process of establishing a virtual server locally in the terminal is consistent with the prior art. By establishing the virtual server and determining the virtual server domain name, the browser in the terminal can be established through the domain name access of the virtual server. The virtual server local to the terminal establishes a basis for the browser to call the resource file to be debugged saved locally.

繼續沿用上例,假設該PC在接收到該替換指令後,在該PC上建立了虛擬伺服器α,並確定其域名為:https://www.YY.com。 Continuing with the above example, it is assumed that the PC establishes the virtual server α on the PC after receiving the replacement instruction, and determines that the domain name is: https://www.YY.com.

S203:通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。 S203: Replace, by the virtual server, an access path for accessing the network resource file to an access path for accessing a local resource file to be debugged.

在本發明實施例中,當建立了虛擬伺服器之後,便可為該待調試資源文件產生存取路徑,使該瀏覽器可以根據該待調試資源文件的存取路徑調用該待調試資源文件。但是,此時該瀏覽器根據該https網頁的網頁代碼存取的還是該網路資源文件的路徑,所以還需要將存取該網路資源文件的存取路徑替換為存取該待調試資源文件的存取路徑。 In the embodiment of the present invention, after the virtual server is established, an access path may be generated for the resource file to be debugged, so that the browser can invoke the resource file to be debugged according to the access path of the resource file to be debugged. However, at this time, the browser accesses the path of the network resource file according to the webpage code of the https webpage, so it is also necessary to replace the access path of accessing the network resource file to access the resource file to be debugged. Access path.

具體的,首先根據該虛擬伺服器的域名以及該待調試文件的地址,產生該待調試文件的存取路徑(即,該待調試資源文件的虛擬域名),則此時可以認為該待調試資源文件是儲存於該虛擬伺服器中的文件。 Specifically, the accessing path of the file to be debugged (that is, the virtual domain name of the resource file to be debugged) is generated according to the domain name of the virtual server and the address of the file to be debugged. A file is a file stored in the virtual server.

其次,修改該終端的網路配置,將存取該網路資源文件的存取路徑替換為存取該待調試資源文件的存取路徑。 使得當該終端接收到該瀏覽器發送的基於該網路資源文件的存取路徑的存取、調用或查詢請求時,根據上述存取路徑的替換關係,使該虛擬伺服器接收該存取、調用、查詢請求,並且將該存取、調用、查詢請求的目的地指向該待調試資源文件的存取路徑。 Secondly, the network configuration of the terminal is modified, and the access path for accessing the network resource file is replaced with an access path for accessing the resource file to be debugged. When the terminal receives an access, call or query request based on the access path of the network resource file sent by the browser, the virtual server receives the access according to the replacement relationship of the access path. The request is invoked, the request is made, and the destination of the access, call, and query request is directed to the access path of the resource file to be debugged.

另外,為了後續調試過程中可以最大程度上利用線上的真實資料運行該https網頁,保證調試結果的可靠性,在本發明中可僅修改針對該網路資源文件的存取路徑為該待調試資源文件的存取路徑,而不改動該瀏覽器發出的針對其他資源文件存取路徑,使得當該瀏覽器在調用該https網頁上的其他資源文件時,根據該https網頁確定的存取路徑沒有被改變,該瀏覽器最終調用的還是網路上的其他資源文件,而當該瀏覽器調用該網路資源文件時,該瀏覽器確定的存取路徑被替換為指向該終端本地的該待調試資源文件,該瀏覽器調用的是本地保存的該待調試資源文件。進而使得在後續的調試過程中,該瀏覽器可以最大程度上使用線上的真實資料,使工作人員僅調試該該調試資源文件。 In addition, in the subsequent debugging process, the https webpage can be run to the greatest extent by using the real data on the line to ensure the reliability of the debugging result. In the present invention, only the access path for the network resource file can be modified as the resource to be debugged. The access path of the file without changing the access path of other resource files issued by the browser, so that when the browser is calling other resource files on the https webpage, the access path determined according to the https webpage is not Change, the browser finally calls other resource files on the network, and when the browser invokes the network resource file, the access path determined by the browser is replaced with the resource file to be debugged locally to the terminal. The browser calls the locally saved resource file to be debugged. In addition, in the subsequent debugging process, the browser can use the real data on the line to the maximum extent, so that the staff can debug only the debugging resource file.

需要說明的是,為該待調試資源產生存取路徑的方法與現有技術相同,可任意為該待調試資源文件產生一個基於該虛擬伺服器域名的存取路徑,並記錄該存取路徑與該待調試資源文件的地址的對應關係,使得該虛擬伺服器可以可根據該存取路徑確定該待調試資源文件。 It should be noted that the method for generating an access path for the resource to be debugged is the same as the prior art, and an access path based on the virtual server domain name may be generated for the resource file to be debugged, and the access path is recorded. Corresponding relationship of the address of the resource file to be debugged, so that the virtual server can determine the resource file to be debugged according to the access path.

繼續沿用上例,假設該PC通過該虛擬伺服器α的域 名https://www.YY.com以及該待調試資源文件b.js的地址E:\調試工作\待調試文件\b.js,產生所述待調試資源文件b.js的存取路徑:https://www.YY.com/b.js。並且,該PC還將網路配置中存取路徑https://www.XX.com/XX/a.js替換為https://www.YY.com/b.js。使得當該PC接收到終端瀏覽器B發出的針對該https網頁A的音頻JS文件的調用請求時,根據網路配置中修改的存取路徑,該虛擬伺服器α接收該調用請求,並根據存取路徑https://www.YY.com/b.js調用該待調試資源文件b.js。 Continue to use the above example, assuming that the PC passes the domain of the virtual server α Name https://www.YY.com and the address of the resource file b.js to be debugged E:\Debug work\to be debugged file\b.js, the access path of the resource file b.js to be debugged is generated: Https://www.YY.com/b.js. Also, the PC replaces the access path https://www.XX.com/XX/a.js in the network configuration with https://www.YY.com/b.js. When the PC receives the call request from the terminal browser B for the audio JS file of the https webpage A, the virtual server a receives the call request according to the modified access path in the network configuration, and according to the save request Take the path https://www.YY.com/b.js to call the resource file b.js to be debugged.

S204:為所述虛擬伺服器產生根證書。 S204: Generate a root certificate for the virtual server.

在本發明實施例中,步驟S101中已經寫明,本發明是基於https網頁的,而對於https網頁來說,該瀏覽器與該虛擬伺服器間的傳輸需要進行通信加密,於是為了使該虛擬伺服器能對與該瀏覽器間的傳輸進行通信加密,還需要為該虛擬伺服器產生根證書。 In the embodiment of the present invention, it has been stated in step S101 that the present invention is based on a https webpage, and for the https webpage, the transmission between the browser and the virtual server needs to be encrypted by communication, so that in order to make the virtual The server can encrypt and encrypt the transmission with the browser, and also needs to generate a root certificate for the virtual server.

具體的,由於該根證書僅作為該虛擬伺服器的安全證書在該終端中使用,所以無需權威的、公信力較高的安全證書(如,證書授權中心,Certificate Authority,頒發的CA證書),僅需能欺騙該瀏覽器,使該瀏覽器可以與該虛擬伺服器件的傳輸進行通信加密即可。 Specifically, since the root certificate is only used as the security certificate of the virtual server in the terminal, an authoritative and highly credible security certificate (for example, a certificate authority, a certificate issued by a certificate authority) is not required. The browser needs to be able to spoof the browser so that the browser can communicate with the transmission of the virtual servo device.

需要說明的是,該根證書是各種類型的安全證書,如,域名型SSL(Domain Validation SSL,DVSSL)證書、企業型SSL(Organization Validation SSL,OVSSL)證書、增強型SSL(Extended Validation SSL,EVSSL) 證書、通配符SSL(Wildcard SSL)證書,本發明對此並不具體限定。 It should be noted that the root certificate is various types of security certificates, such as Domain Validation SSL (DVSSL) certificate, Enterprise SSL (Organization Validation SSL, OVSSL) certificate, and Extended SSL (Extended Validation SSL, EVSSL). ) The certificate and the wildcard SSL certificate are not specifically limited in the present invention.

繼續沿用上例,假設,為該虛擬伺服器α產生了根證書β。 Continuing with the above example, assume that a root certificate β is generated for the virtual server a.

S205:根據所述根證書,產生子證書。 S205: Generate a sub-certificate according to the root certificate.

在本發明實施例中,當為該虛擬伺服器產生了根證書之後(即,為該虛擬伺服器頒發了自簽證書之後),為了使該瀏覽器可以調用保存於該終端本地的該待調試資源文件,該虛擬伺服器還可根據該根證書,產生用於發送給該瀏覽器的子證書,以便該瀏覽器可以根據該子證書確定該待調試資源文件是安全的。產生了根證書及其子證書後,該瀏覽器即可與該虛擬伺服器進行基於https網頁的通信連接。 In the embodiment of the present invention, after the root certificate is generated for the virtual server (that is, after the virtual server is issued the self-signed certificate), in order to enable the browser to call the to-be-debug stored locally in the terminal. The resource file, the virtual server may further generate a sub-certificate for sending to the browser according to the root certificate, so that the browser may determine, according to the sub-certificate, that the to-be-debug resource file is secure. After the root certificate and its sub-certificates are generated, the browser can perform a https-based web-based communication connection with the virtual server.

具體的與現有技術一致,該虛擬伺服器基於該根證書產生用於發送給該瀏覽器的子證書,使得當該終端中的該瀏覽器在根據該https網頁發起對該網路資源文件的調用請求時,由該虛擬伺服器接收到該調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向該瀏覽器返回該待調試資源文件以及該子證書,進而使該瀏覽器根據該子證書確定該待調試資源文件是安全的,獲取並執行該待調試資源文件。 Specifically, in accordance with the prior art, the virtual server generates a sub-certificate for sending to the browser based on the root certificate, so that the browser in the terminal initiates a call to the network resource file according to the https webpage. At the request, the virtual server receives the call request, and returns the resource file to be debugged and the sub-certificate to the browser according to the access path that is replaced by accessing the local resource file to be debugged, thereby causing the browser to The resource file to be debugged is determined to be secure according to the sub-certificate, and the resource file to be debugged is obtained and executed.

繼續沿用上例,假設,該虛擬伺服器根據該根證書β產生子證書γ,則當該瀏覽器B在根據該https網頁A向https://www.XX.com/XX/a.js發起調用請求時,該虛擬伺 服器α接收到向https://www.YY.com/b.js發起的調用請求,則該虛擬伺服器α向該瀏覽器返回該待調試資源文件b.js以及該子證書γ,使得該瀏覽器B在接收到該待調試資源文件b.js以及該子證書γ後,根據該子證書γ確定該待調試資源文件b.js安全可用,獲取並執行該待調試資源文件b.js。 Continuing with the above example, assume that the virtual server generates the sub-certificate γ according to the root certificate β, then when the browser B is launched according to the https page A to https://www.XX.com/XX/a.js The virtual servo when the request is called The server a receives the call request initiated to https://www.YY.com/b.js, and the virtual server α returns the resource file b.js to be debugged and the sub-certificate γ to the browser, so that the server After receiving the resource file b.js to be debugged and the sub-certificate γ, the browser B determines that the resource file b.js to be debugged is safely available according to the sub-certificate γ, and obtains and executes the resource file b.js to be debugged. .

通過如圖2所示的調用文件方法,可見,由於為該虛擬伺服器產生了根證書以及子證書,所以即使對於瀏覽器根據https網頁發起的網路資源文件的調用請求,該虛擬伺服器也可通過該根證書欺騙該瀏覽器,使該瀏覽器確定該虛擬伺服器是提供該https網頁中的網路資源文件的伺服器,並且,該虛擬服務通過向該瀏覽器返回該待調試資源文件以及該子證書,使得該待調試資源文件可以通過該子證書欺騙該瀏覽器,讓該瀏覽器確定該待調試資源文件的身份是安全的。從而實現https網頁中的網路資源文件的替換,並使該瀏覽器可以獲取、執行本地的待調試資源文件。使得工作人員後續可以在終端本地對出現問題的https網頁中的網路資源文件進行調試。 Through the call file method shown in FIG. 2, it can be seen that since the root certificate and the sub-certificate are generated for the virtual server, even if the browser requests the web resource file initiated by the browser according to the https webpage, the virtual server also The browser may be spoofed by the root certificate, so that the browser determines that the virtual server is a server that provides a network resource file in the https webpage, and the virtual service returns the resource file to be debugged by returning to the browser. And the sub-certificate, so that the to-be-debug resource file can spoof the browser by using the sub-certificate, so that the browser determines that the identity of the resource file to be debugged is secure. Thereby, the replacement of the network resource file in the https webpage is implemented, and the browser can acquire and execute the local resource file to be debugged. The staff can then debug the network resource files in the https webpage where the problem occurs locally.

另外,如在步驟S201中所述的,該待調試資源文件可以是任意文件,於是,為了後續可以對該待調試資源文件進行調試,在本發明中還可以下載該網路資源文件至該待調試資源文件的地址。 In addition, as described in step S201, the resource file to be debugged may be an arbitrary file, so that the network resource file may be downloaded to the standby in the present invention. The address of the debug resource file.

具體的,該終端可根據該替換指令,確定該網路資源文件的存取路徑,並根據該網路資源文件的存取路徑下載 該網路資源文件至該待調試資源文件的地址,則此時該待調試資源文件不再是任意文件,而已經被替換為已下載的該網路資源文件,於是後續工作人員可以在本地對該待調試資源文件進行調試。 Specifically, the terminal may determine an access path of the network resource file according to the replacement instruction, and download according to an access path of the network resource file. The network resource file is the address of the resource file to be debugged. At this time, the resource file to be debugged is no longer an arbitrary file, but has been replaced with the downloaded network resource file, so that the follow-up staff can locally The resource file to be debugged is debugged.

需要說明的是,該網路資源文件的下載以及該待調試資源文件的替換可以在本發明中任一步驟中進行,僅需要保證在步驟S203中產生的該待調試資源文件的存取路徑為已替換為網路資源文件的該待調試資源文件的存取路徑即可。 It should be noted that the downloading of the network resource file and the replacement of the resource file to be debugged may be performed in any step of the present invention, and only the access path of the resource file to be debug generated in step S203 is required to be It can be replaced with the access path of the resource file to be debugged of the network resource file.

基於圖2所示的調用文件過程,本發明實施例還提供一種調用文件裝置,如圖3所示。 Based on the call file process shown in FIG. 2, an embodiment of the present invention further provides a call file device, as shown in FIG.

圖3是本發明實施例提供一種調用文件裝置的結構示意圖,具體包括:接收模組301,用於接收https網頁中網路資源文件的替換指令;執行模組302,用於根據所述替換指令,在本地建立虛擬伺服器;替換模組303,用於通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑;根證書模組304,用於為所述虛擬伺服器產生根證書;子證書模組305,用於根據所述根證書,產生子證書,使得當本地瀏覽器根據所述https網頁發起對所述網 路資源文件的調用請求時,由所述虛擬伺服器接收到所述調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向所述瀏覽器返回所述待調試資源文件以及所述子證書,使所述瀏覽器根據所述子證書,獲取並執行所述待調試資源文件。 FIG. 3 is a schematic structural diagram of a device for invoking a file according to an embodiment of the present invention, which specifically includes: a receiving module 301, configured to receive a replacement instruction of a network resource file in a https webpage; and an execution module 302, configured to perform, according to the replacement instruction Establishing a virtual server locally; the replacement module 303 is configured to replace, by the virtual server, an access path for accessing the network resource file to an access path for accessing a local resource file to be debugged; a certificate module 304, configured to generate a root certificate for the virtual server, and a sub-certificate module 305, configured to generate a sub-certificate according to the root certificate, so that when the local browser initiates the network according to the https webpage Receiving the call request by the virtual server, and returning the to-be-debug resource file to the browser according to an access path replaced with accessing the local resource file to be debugged The sub-certificate enables the browser to acquire and execute the resource file to be debugged according to the sub-certificate.

所述替換指令包含:所述網路資源文件的標識、所述網路資源文件的存取路徑、預先保存在本地的所述待調試資源文件的標識及所述待調試資源文件地址。 The replacement instruction includes: an identifier of the network resource file, an access path of the network resource file, an identifier of the resource file to be debugged stored in advance, and a resource file address to be debugged.

執行模組302具體用於,根據所述替換請求,在本地建立虛擬伺服器,並確定所述虛擬伺服器的域名。 The execution module 302 is specifically configured to establish a virtual server locally according to the replacement request, and determine a domain name of the virtual server.

替換模組303具體用於,根據所述虛擬伺服器的域名以及所述待調試資源文件地址,產生所述待調試資源的存取路徑,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。 The replacement module 303 is specifically configured to generate an access path of the resource to be debugged according to the domain name of the virtual server and the resource file address to be debugged, and replace the access path of the network resource file. The access path for accessing the local resource file to be debugged.

所述裝置還包括:下載模組306,用於下載所述網路資源文件至所述待調試資源文件的地址。 The device further includes: a downloading module 306, configured to download the network resource file to an address of the resource file to be debugged.

具體的,上述如圖3所示的資料庫語句編譯裝置可以位於終端中,該終端可以是手機、平板電腦或者PC。 Specifically, the database statement compiling device shown in FIG. 3 may be located in a terminal, and the terminal may be a mobile phone, a tablet computer or a PC.

在一個典型的配置中,計算設備包括一個或多個處理器(CPU)、輸入/輸出介面、網路介面和隨機存取記憶體。 In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, a network interface, and random access memory.

隨機存取記憶體可能包括計算機可讀媒體中的非永久性記憶體,隨機存取記憶體(RAM)和/或非易失性隨機 存取記憶體等形式,如唯讀記憶體(ROM)或閃存(flash RAM)。隨機存取記憶體是計算機可讀媒體的示例。 Random access memory may include non-persistent memory, random access memory (RAM) and/or non-volatile randomness in a computer readable medium. Access memory and other forms, such as read only memory (ROM) or flash memory (flash RAM). Random access memory is an example of a computer readable medium.

計算機可讀媒體包括永久性和非永久性、可移動和非可移動媒體可以由任何方法或技術來實現資訊儲存。資訊可以是計算機可讀指令、資料結構、程式的模組或其他資料。計算機的儲存媒體的例子包括,但不限於相變隨機存取記憶體(PRAM)、靜態隨機存取記憶體(SRAM)、動態隨機存取記憶體(DRAM)、其他類型的隨機存取記憶體(RAM)、唯讀記憶體(ROM)、電可擦除可編程唯讀記憶體(EEPROM)、快閃記憶體或其他隨機存取記憶體技術、光碟唯讀記憶體(CD-ROM)、數位多功能光碟(DVD)或其他光學儲存、磁盒式磁帶,磁帶磁盤儲存或其他磁性儲存設備或任何其他非傳輸媒體,可用於儲存可以被計算設備存取的資訊。按照本文中的界定,計算機可讀媒體不包括暫存電腦可讀媒體(transitory media),如調變的資料信號和載波。 Computer readable media including both permanent and non-permanent, removable and non-removable media can be stored by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other materials. Examples of computer storage media include, but are not limited to, phase change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), and other types of random access memory. (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other random access memory technology, CD-ROM, Digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices or any other non-transportable media that can be used to store information that can be accessed by computing devices. As defined herein, computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.

還需要說明的是,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、商品或者設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、商品或者設備所固有的要素。在沒有更多限制的情況下,由語句“包括一個......”限定的要素,並不排除在包括所述要素的過程、方法、商品或者設備中還存在另外的相同要素。 It is also to be understood that the terms "comprises" or "comprising" or "comprising" or any other variations are intended to encompass a non-exclusive inclusion, such that a process, method, article, Other elements not explicitly listed, or elements that are inherent to such a process, method, commodity, or equipment. An element defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device including the element.

本領域技術人員應明白,本發明的實施例可提供為方法、系統或計算機程式產品。因此,本發明可採用完全硬體實施例、完全軟體實施例或結合軟體和硬體方面的實施例的形式。而且,本發明可採用在一個或多個其中包含有計算機可用程式代碼的計算機可用儲存媒體(包括但不限於磁盤記憶體、CD-ROM、光學記憶體等)上實施的計算機程式產品的形式。 Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Thus, the invention may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining the software and hardware. Moreover, the present invention can take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) in which computer usable code is embodied.

以上所述僅為本發明的實施例而已,並不用於限制本發明。對於本領域技術人員來說,本發明可以有各種更改和變化。凡在本發明的精神和原理之內所作的任何修改、等同替換、改進等,均應包含在本發明的申請專利範圍之內。 The above description is only an embodiment of the present invention and is not intended to limit the present invention. It will be apparent to those skilled in the art that various modifications and changes can be made in the present invention. Any modifications, equivalents, improvements, etc. made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (10)

一種調用文件方法,所述方法包括:接收針對安全套接字層超文本傳輸協議https網頁中網路資源文件的替換指令;根據所述替換指令,在本地建立虛擬伺服器;通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑;為所述虛擬伺服器產生根證書;根據所述根證書,產生子證書,使得當本地瀏覽器根據所述https網頁發起對所述網路資源文件的調用請求時,由所述虛擬伺服器接收到所述調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向所述瀏覽器返回所述待調試資源文件以及所述子證書,使所述瀏覽器根據所述子證書,獲取並執行所述待調試資源文件。 A method for calling a file, the method comprising: receiving a replacement instruction for a network resource file in a Secure Sockets Layer Hypertext Transfer Protocol https webpage; establishing a virtual server locally according to the replacement instruction; And replacing an access path for accessing the network resource file with an access path for accessing a local resource file to be debugged; generating a root certificate for the virtual server; and generating a sub-certificate according to the root certificate, so that When the local browser initiates a call request for the network resource file according to the https webpage, the virtual server receives the call request and replaces the access path of the local resource file to be debugged according to the replacement And returning, to the browser, the resource file to be debugged and the sub-certificate, so that the browser acquires and executes the resource file to be debugged according to the sub-certificate. 如申請專利範圍第1項所述的方法,其中,所述替換指令包含:所述網路資源文件的標識、所述網路資源文件的存取路徑、預先保存在本地的所述待調試資源文件的標識及所述待調試資源文件地址。 The method of claim 1, wherein the replacement instruction comprises: an identifier of the network resource file, an access path of the network resource file, and the to-be-debug resource saved in advance locally. The identifier of the file and the address of the resource file to be debugged. 如申請專利範圍第2項所述的方法,其中,根據所述替換指令,在本地建立虛擬伺服器,包括:根據所述替換請求,在本地建立虛擬伺服器,並確定所述虛擬伺服器的域名。 The method of claim 2, wherein the establishing a virtual server locally according to the replacement instruction comprises: locally establishing a virtual server according to the replacement request, and determining the virtual server domain name. 如申請專利範圍第3項所述的方法,其中,通過所述虛擬伺服器,將存取網路資源文件的存取路徑替換為 存取本地待調試資源文件的存取路徑,包括:根據所述虛擬伺服器的域名以及所述待調試資源文件地址,產生所述待調試資源的存取路徑;將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。 The method of claim 3, wherein the access path of the access network resource file is replaced by the virtual server Accessing the access path of the resource file to be debugged, including: generating an access path of the resource to be debugged according to the domain name of the virtual server and the resource file address to be debugged; accessing the network resource The file access path is replaced with an access path to access the local resource file to be debugged. 如申請專利範圍第2項所述的方法,其中,所述方法還包括:下載所述網路資源文件至所述待調試資源文件的地址。 The method of claim 2, wherein the method further comprises: downloading the network resource file to an address of the resource file to be debugged. 一種調用文件的裝置,包括:接收模組,用於接收安全套接字層超文本傳輸協議https網頁中網路資源文件的替換指令;執行模組,用於根據所述替換指令,在本地建立虛擬伺服器;替換模組,用於通過所述虛擬伺服器,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑;根證書模組,用於為所述虛擬伺服器產生根證書;子證書模組,用於根據所述根證書,產生子證書,使得當本地瀏覽器根據所述https網頁發起對所述網路資源文件的調用請求時,由所述虛擬伺服器接收到所述調用請求,並根據替換為存取本地待調試資源文件的存取路徑,向所述瀏覽器返回所述待調試資源文件以及所述子證書,使所述瀏覽器根據所述子證書,獲取並執行所述待調試資 源文件。 An apparatus for invoking a file, comprising: a receiving module, configured to receive a replacement instruction of a network resource file in a secure socket layer hypertext transfer protocol https webpage; and an execution module, configured to locally establish according to the replacement instruction a virtual server; a replacement module, configured to replace, by the virtual server, an access path for accessing the network resource file to an access path for accessing a local resource file to be debugged; a root certificate module, Generating a root certificate for the virtual server; the sub-certificate module is configured to generate a sub-certificate according to the root certificate, so that when the local browser initiates a call request for the network resource file according to the https webpage Receiving, by the virtual server, the call request, and returning the to-be-debuved resource file and the sub-certificate to the browser according to an access path replaced with accessing a local resource file to be debugged, so that the The browser obtains and executes the to-be-debug according to the sub-certificate Source File. 如申請專利範圍第6項所述的裝置,其中,所述替換指令包含:所述網路資源文件的標識、所述網路資源文件的存取路徑、預先保存在本地的所述待調試資源文件的標識及所述待調試資源文件地址。 The device of claim 6, wherein the replacement instruction comprises: an identifier of the network resource file, an access path of the network resource file, and the to-be-debug resource saved in advance locally. The identifier of the file and the address of the resource file to be debugged. 如申請專利範圍第7項所述的裝置,其中,執行模組用於,根據所述替換請求,在本地建立虛擬伺服器,並確定所述虛擬伺服器的域名。 The device of claim 7, wherein the execution module is configured to establish a virtual server locally according to the replacement request, and determine a domain name of the virtual server. 如申請專利範圍第8項所述的裝置,其中,替換模組用於,根據所述虛擬伺服器的域名以及所述待調試資源文件地址,產生所述待調試資源的存取路徑,將存取所述網路資源文件的存取路徑替換為存取本地待調試資源文件的存取路徑。 The device of claim 8, wherein the replacement module is configured to generate an access path of the resource to be debugged according to the domain name of the virtual server and the resource file address to be debugged, and the The access path of the network resource file is replaced with an access path for accessing the local resource file to be debugged. 如申請專利範圍第7項所述的裝置,其中,所述裝置還包括:下載模組,用於下載所述網路資源文件至所述待調試資源文件的地址。 The device of claim 7, wherein the device further comprises: a downloading module, configured to download the network resource file to an address of the resource file to be debugged.
TW106102210A 2016-03-29 2017-01-20 Method and device for calling a file TWI672019B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
??201610189253.7 2016-03-29
CN201610189253.7A CN107239475B (en) 2016-03-29 2016-03-29 File calling method and device

Publications (2)

Publication Number Publication Date
TW201735583A true TW201735583A (en) 2017-10-01
TWI672019B TWI672019B (en) 2019-09-11

Family

ID=59963470

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106102210A TWI672019B (en) 2016-03-29 2017-01-20 Method and device for calling a file

Country Status (3)

Country Link
CN (1) CN107239475B (en)
TW (1) TWI672019B (en)
WO (1) WO2017167051A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508437A (en) * 2018-11-21 2019-03-22 深信服科技股份有限公司 A kind of search website auditing method, system and gateway and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110768940B (en) * 2018-07-27 2022-03-22 深信服科技股份有限公司 Ciphertext data management and control method and system based on HTTPS (Hypertext transfer protocol secure) protocol, proxy server and storage medium
CN113507529B (en) * 2021-07-26 2022-12-06 上海中通吉网络技术有限公司 Method for realizing file downloading based on Web application

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7509490B1 (en) * 2000-05-26 2009-03-24 Symantec Corporation Method and apparatus for encrypted communications to a secure server
US7370351B1 (en) * 2001-03-22 2008-05-06 Novell, Inc. Cross domain authentication and security services using proxies for HTTP access
US8386785B2 (en) * 2008-06-18 2013-02-26 Igt Gaming machine certificate creation and management
CN102214224A (en) * 2011-06-15 2011-10-12 中兴通讯股份有限公司 Network resource access optimizing method, Web page browser and terminal
CN102916958A (en) * 2012-10-15 2013-02-06 福建榕基软件股份有限公司 Method and system for realizing access encryption of mobile terminal browser
CN103065078A (en) * 2013-01-04 2013-04-24 无锡矽鼎科技有限公司 Method of loading client certificate for Android system by OpenSSL engine
JP6007149B2 (en) * 2013-05-24 2016-10-12 日本電信電話株式会社 Web browsing history acquisition apparatus, method, and program
US9560038B2 (en) * 2014-06-20 2017-01-31 Adobe Systems Incorporated Method and apparatus for verifying an application to authorize content repository access using SSL certificates
CN104539682A (en) * 2014-12-19 2015-04-22 乐视网信息技术(北京)股份有限公司 Debug method, device, mobile terminal, server and system for mobile webpage
CN105404504B (en) * 2015-11-02 2018-12-25 北京锐安科技有限公司 A kind of adjustment method and device of Web component

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508437A (en) * 2018-11-21 2019-03-22 深信服科技股份有限公司 A kind of search website auditing method, system and gateway and storage medium
CN109508437B (en) * 2018-11-21 2021-05-04 深信服科技股份有限公司 Search website auditing method, system, gateway equipment and storage medium

Also Published As

Publication number Publication date
TWI672019B (en) 2019-09-11
CN107239475B (en) 2020-09-18
WO2017167051A1 (en) 2017-10-05
CN107239475A (en) 2017-10-10

Similar Documents

Publication Publication Date Title
TWI687113B (en) Method and server for determining whether the terminal logging in to the website is a mobile terminal
US20190266200A1 (en) Systems and methods for redirecting to track user identifiers across different websites
TWI614630B (en) Client application login method and its corresponding server
CN106354481B (en) Method and equipment for uniformly mapping HTTP (hyper text transport protocol) request
JP6898452B2 (en) Data acquisition method and device
WO2017045563A1 (en) Web app access method, apparatus, and system
TWI718232B (en) Business execution method and device
US8356281B2 (en) Method, system and program product for recording and replaying target service interaction data
US11120107B2 (en) Managing content delivery to client devices
TWI671642B (en) Method for sharing data across applications and web browser
US20140136937A1 (en) Providing and procuring worksheet functions through an online marketplace
US10031837B1 (en) Dynamic service debugging in a virtual environment
TW201616382A (en) Account login method and device
US9146841B2 (en) Proxy server assisted product testing
CN108769189B (en) Cross-network-domain resource access method and device
WO2017028695A1 (en) Method and apparatus for publishing webpage application
TWI672019B (en) Method and device for calling a file
TWI677223B (en) Page display method and device
AU2018390863B2 (en) Computer system and method for extracting dynamic content from websites
US11429400B2 (en) User interface metadata from an application program interface
CN114462101A (en) Processing system, method and device for application apk packet
CN113434384B (en) Pressure testing method and device
US11025593B2 (en) Template-based session control in proxy solutions
CN115865717A (en) Access request processing method and device, processor and electronic equipment
US9251361B1 (en) Data transmission to an untrusted entity