Remote debugging method and system, electronic equipment, readable medium and program product
By using a proxy server for user authentication and port management, the problems of complex configuration, low efficiency, and poor security in remote debugging are solved, and a remote debugging solution that simplifies configuration, improves efficiency, and enhances security is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
- Filing Date
- 2024-10-16
- Publication Date
- 2026-04-17
AI Technical Summary
Remote debugging is complex to configure, inefficient, and insecure. It is especially difficult to achieve effective debugging in isolated network environments, and the debugging port is easily exploited by unauthorized users, leading to data leakage or system crashes.
User authentication and port management are handled by a proxy server. The client only needs to enter the remote debugging address information, and the proxy server will verify permissions, allocate ports, and forward remote debugging requests to achieve remote debugging.
It simplifies remote debugging configuration, improves debugging efficiency and security, ensures normal debugging even in isolated network environments, and reduces the risk of unauthorized users exploiting the debugging port.
Smart Images

Figure CN121880159A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this disclosure relate to the field of computer technology, and more specifically to remote debugging methods, systems, electronic devices, readable media, and program products. Background Technology
[0002] Remote debugging is a common and important feature in software development. Typically, developers can set up remote debugging directly within an integrated development environment (IDE) such as IDEA, and then connect to a remote server's debug port to execute and debug code.
[0003] However, the inventors discovered that the above method often presents the following technical problems: Developers need to correctly configure the local and remote server IPs and debugging ports according to remote debugging tutorials, and also need to consider the complexity and security of the network environment. If network problems exist, network-level load balancing is also required, making the configuration cumbersome and complex. In isolated network environments, direct remote debugging may not be feasible or may be inefficient due to network policies or firewall restrictions. Because it requires a direct connection to the remote server's debugging port, if the debugging port is exploited by other unauthorized users, it may lead to data leakage or system crashes, resulting in poor security.
[0004] The information disclosed in this background section is only intended to enhance the understanding of the background of the inventive concept, and therefore may contain information that does not form prior art known to those skilled in the art. Summary of the Invention
[0005] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0006] Some embodiments of this disclosure provide remote debugging methods, systems, electronic devices, computer-readable media, and computer program products to address one or more of the technical problems mentioned in the background section above.
[0007] In a first aspect, some embodiments of this disclosure provide a remote debugging method applied to a proxy server. The method includes: in response to receiving remote debugging address information input by a user on a client, performing user authentication processing based on the user's user identifier and the remote debugging address information to obtain a user authentication result; determining whether the remote server has opened a debugging port corresponding to the remote debugging address information; in response to determining that the remote server has opened the debugging port corresponding to the remote debugging address information, and that the user authentication result indicates successful authentication, sending the proxy address information and port information to the client, enabling the client to perform remote debugging connection and remote debugging based on the proxy address information and the port information; and in response to detecting a remote debugging request sent by the client, forwarding the remote debugging request to the debugging port corresponding to the remote debugging address information.
[0008] Optionally, before forwarding the remote debugging request to the debugging port corresponding to the remote debugging address information in response to detecting the remote debugging request sent by the client, the method further includes binding the remote debugging address information and the client's exit address information.
[0009] Optionally, the above-mentioned response to detecting the remote debugging request sent by the client and forwarding the remote debugging request to the debugging port corresponding to the remote debugging address information includes: in response to detecting the remote debugging request from the client, reading the exit address information from the remote debugging request; determining the remote debugging address information bound to the read exit address information; and forwarding the remote debugging request to the debugging port corresponding to the determined remote debugging address information.
[0010] Optionally, the above-mentioned user authentication process based on the user's identifier and the remote debugging address information to obtain the user authentication result includes: obtaining permission information corresponding to the user's identifier and the remote debugging address information; and determining the permission information as the user authentication result.
[0011] Secondly, some embodiments of this disclosure provide a remote debugging method applied to a client. The method includes: receiving remote debugging address information input by a user; in response to detecting a selection operation performed on a remote debugging control, sending the remote debugging address information to a proxy server; in response to receiving proxy address information and port information sent by the proxy server, saving the proxy address information and port information as remote debugging configuration information; and sending a remote debugging request to the proxy server according to the remote debugging configuration information, so that the proxy server forwards the remote debugging request to the debugging port corresponding to the remote debugging address information.
[0012] Optionally, sending a remote debugging request to the proxy server based on the remote debugging configuration information includes: sending a remote debugging connection request to the proxy server based on the remote debugging configuration information; and sending a remote debugging request corresponding to the remote debugging operation to the proxy server in response to detecting a remote debugging operation.
[0013] Thirdly, some embodiments of this disclosure provide a remote debugging system, including: a client configured to execute the method described in any implementation of the second aspect; a proxy server configured to execute the method described in any implementation of the first aspect; and a remote server configured to provide remote services.
[0014] Fourthly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first or second aspect above.
[0015] Fifthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first or second aspect.
[0016] Sixthly, some embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the implementations of the first or second aspect above.
[0017] The above embodiments of this disclosure have the following beneficial effects: the remote debugging methods of some embodiments of this disclosure simplify the configuration operation of remote debugging and improve the efficiency and security of remote debugging. Specifically, the reason why the configuration operation of remote debugging is complex, inefficient, and insecure is that developers need to correctly configure the local and remote server IP and debugging port according to the remote debugging tutorial, and also need to consider the complexity and security issues of the network environment. If there are network problems, network-level load balancing is also required, resulting in a cumbersome and complex configuration. In the case of network isolation, due to network policies or firewall restrictions, direct remote debugging may not be able to be executed or may be inefficient. Since it is necessary to directly connect to the debugging port of the remote server, if the debugging port is used by other unauthorized users, it may lead to data leakage or system crash, resulting in poor security. Based on this, the remote debugging method of some embodiments of this disclosure firstly, in response to receiving the remote debugging address information input by the user on the client, performs user authentication processing based on the user's user identifier and the remote debugging address information to obtain the user authentication result. Thus, the user's permissions for the remote debugging address information can be authenticated first to determine whether the user has the right to debug the remote service corresponding to the remote debugging address information. Then, it is determined whether the remote server has opened the debugging port corresponding to the aforementioned remote debugging address information. This allows for pre-determining whether the remote server has opened the port corresponding to the remote service for the remote debugging address information. Next, in response to the determination that the remote server has opened the debugging port corresponding to the aforementioned remote debugging address information, and the aforementioned user authentication result indicates successful authentication, the proxy address information and port information are sent to the aforementioned client, enabling the client to establish a remote debugging connection and perform remote debugging based on the aforementioned proxy address information and port information. Therefore, when the remote server has opened the debugging port corresponding to the aforementioned remote debugging address information and user authentication is successful, a proxy address and port can be assigned to the client, allowing the client to communicate with the proxy server through the assigned proxy address and port. Afterwards, in response to detecting a remote debugging request sent by the aforementioned client, the remote debugging request is forwarded to the aforementioned debugging port corresponding to the aforementioned remote debugging address information. Thus, the proxy server can be used to forward the client's remote debugging request to the remote server's debugging port to achieve remote debugging. Furthermore, since remote debugging only requires the user to input the remote debugging address information on the client, eliminating the need for complex configuration by the user, the configuration operation for remote debugging is simplified. Furthermore, because the client does not perform remote debugging directly, but forwards it through the proxy server, remote debugging can still be achieved even in isolated network environments, thus preventing remote debugging from failing or becoming inefficient and improving the efficiency of remote debugging.Furthermore, because the client does not need to directly connect to the remote server's debugging port, but instead forwards the connection through a proxy server, the possibility of the debugging port being exploited by other unauthorized users is reduced, thereby improving the security of remote debugging. This simplifies the configuration process for remote debugging and improves both its efficiency and security. Attached Figure Description
[0018] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0019] Figure 1 This is an architecture diagram of an exemplary system to which some embodiments of this disclosure can be applied;
[0020] Figure 2 This is a flowchart of some embodiments of the remote debugging method applied to a proxy server according to the present disclosure;
[0021] Figure 3 This is a flowchart of some embodiments of the remote debugging method applied to a client according to the present disclosure;
[0022] Figure 4 This is a schematic diagram of the structure of some embodiments of the remote debugging system according to the present disclosure;
[0023] Figure 5 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation
[0024] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0025] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0026] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0027] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0028] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0029] Before performing any of the operations involving the collection, storage, or use of user personal information (such as user identifiers) disclosed in this disclosure, the relevant organizations or individuals shall fulfill their obligations, including conducting personal information security impact assessments, informing personal information subjects, and obtaining prior authorization and consent from personal information subjects.
[0030] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0031] Figure 1 An exemplary system architecture 100 is shown that can be applied to remote debugging methods or remote debugging systems according to some embodiments of the present disclosure.
[0032] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, network 104, proxy servers 105 and 106, network 107, and remote server 108. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and proxy servers 105 and 106. Network 107 serves as the medium for providing communication links between proxy servers 105 and 106 and remote server 108. Networks 104 and 107 may include various connection types, such as wired or wireless communication links or fiber optic cables. Proxy servers 105 and 106 can be proxy server servers. Terminal devices 101, 102, and 103 can be client terminal devices. Remote server 108 can be a remote server.
[0033] Users can use terminal devices 101, 102, and 103 to interact with proxy servers 105 or 106 via network 104 to receive or send messages, etc. IDEA plugins can be installed on terminal devices 101, 102, and 103. Users can use IDEA plugins to achieve certain specific functions, such as remote debugging. Various communication client applications can also be installed on terminal devices 101, 102, and 103, such as web browser applications, e-commerce applications, search applications, instant messaging tools, email clients, and social media platforms.
[0034] Terminal devices 101, 102, and 103 can be either hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with displays that support information display, including but not limited to smartphones, tablets, e-book readers, laptops, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices. They can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are imposed here.
[0035] Proxy servers 105 and 106 can be servers that provide various reverse proxy services. They can receive client requests, forward these requests to other servers, and return the server's response to the client. Here, the reverse proxy service can be used to implement the forwarding function of remote debugging protocols.
[0036] Remote server 108 can be a server that provides remote services, on which programs that can be stored and run for remote debugging by clients can be stored. Interactions between remote server 108 and clients can be forwarded through proxy servers 105 or 106.
[0037] It should be noted that proxy servers 105 and 106 can be either hardware or software. When proxy servers 105 and 106 are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When proxy servers 105 and 106 are software, they can be implemented as multiple software programs or software modules, for example, to provide distributed services, or as a single software program or software module. No specific limitations are made here.
[0038] It should be noted that the remote server 108 can be either hardware or software. When the remote server 108 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the remote server 108 is software, it can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are made here.
[0039] It should be understood that Figure 1 The number of terminal devices, networks, proxy servers, and remote servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, proxy servers, and remote servers can be included.
[0040] Continue to refer to Figure 2 The diagram illustrates a flow 200 of some embodiments of a remote debugging method applied to a proxy server according to the present disclosure. The remote debugging method includes the following steps:
[0041] Step 201: In response to receiving the remote debugging address information input by the user on the client, perform user authentication processing based on the user's user identifier and the remote debugging address information to obtain the user authentication result.
[0042] In some embodiments, the execution subject of the remote debugging method (e.g. Figure 1 The proxy server shown can respond to the remote debugging address information input by the user on the client, perform user authentication based on the user's identifier and the remote debugging address information, and obtain the user authentication result. The proxy server can be a server providing various reverse proxy services, receiving client requests, forwarding these requests to other servers, and returning the server's response to the client. Here, the reverse proxy service can be used to implement the forwarding function of the remote debugging protocol. The client and the proxy server can connect in LAN mode or public network mode. The client and the proxy server can connect via wired or wireless connection. The proxy server can be deployed with software that supports TCP protocol request forwarding. For example, the software can include, but is not limited to, nginx and haproxy. The proxy server can be configured with multiple ports, each port corresponding to a remote server's debug port. For example, proxy machine port 5001 corresponds to remote server A's debug port 5005. Proxy machine port 5002 corresponds to remote server B's debug port 5005, and so on. The client can have the IDEA plugin installed. Users can input remote debugging address information through the IDEA plugin. The remote debugging address information can be the IP address of the server to be remotely debugged. The user identifier can uniquely identify the user. In practice, the aforementioned execution entity can retrieve the debugging permission information corresponding to the aforementioned user identifier from a user information database. This user information database can be a database storing user-related information. For example, the user information database can be a database used to store user-related information in an ERP system. Each debugging permission information can correspond to a remote debugging address, which may include, but is not limited to, permission information and remote debugging address information. The permission information indicates whether the user has permission to debug the debugging port corresponding to the remote debugging address information. For example, the permission information can be "permitted" or "no permission." When the permission information is "permitted," it indicates that user authentication has passed. When the permission information is "no permission," it indicates that user authentication has failed. Then, the debugging permission information corresponding to the aforementioned remote debugging address information can be determined as the target debugging permission information. Finally, the permission information included in the target debugging permission information can be determined as the user authentication result.
[0043] It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other currently known or future wireless connection methods.
[0044] In some optional implementations of certain embodiments, the aforementioned execution entity may perform user authentication processing based on the user's user identifier and the aforementioned remote debugging address information through the following steps to obtain the user authentication result:
[0045] The first step is to obtain the permission information corresponding to the aforementioned user identifier and remote debugging address. In practice, the executing entity can obtain the permission information corresponding to the aforementioned user identifier and remote debugging address from the user server through the permission information acquisition interface. The permission information acquisition interface can be a pre-encapsulated interface for obtaining user permission-related information stored on the user server. The user server can be the server of the ERP system. The aforementioned user identifier and remote debugging address information can be used as interface parameters of the permission information acquisition interface.
[0046] The second step is to determine the user authentication result using the aforementioned permission information. Therefore, the user authentication result can be directly determined using the permission information from the user server.
[0047] Step 202: Determine whether the remote server has enabled the debugging port corresponding to the remote debugging address information.
[0048] In some embodiments, the executing entity can determine whether the remote server has opened the debug port corresponding to the remote debug address information. The remote server can be the server hosting the application that the user needs to remotely debug. The debug port corresponding to the remote debug address information can be pre-set. In practice, the executing entity can obtain the port status of the debug port corresponding to the remote debug address information from the remote server. Then, in response to determining that the port status indicates the port is open, it can be determined that the remote server has opened the debug port corresponding to the remote debug address information.
[0049] Step 203: In response to determining that the remote server has opened the debugging port corresponding to the remote debugging address information and that the user authentication result indicates that the authentication is successful, the proxy address information and port information are sent to the client, so that the client can make a remote debugging connection and perform remote debugging based on the proxy address information and port information.
[0050] In some embodiments, the executing entity may, in response to determining that the remote server has opened the debugging port corresponding to the remote debugging address information and that the user authentication result indicates successful authentication, send the proxy address information and port information to the client, enabling the client to establish a remote debugging connection and perform remote debugging based on the proxy address information and port information. The proxy address information and port information may be an IP address and port used to provide reverse proxy services to the client. The proxy address information and port information may be an available IP address and available port assigned to the client. The proxy address information and port information may be assigned to the client through a port allocation service.
[0051] Optionally, before step 204, the executing entity may further bind the remote debugging address information and the client's exit address information. The exit address information can be the client's exit IP address. In practice, the executing entity can combine the remote debugging address information and the client's exit address information into mapping information to bind the remote debugging address information and the client's exit address information. This allows for the binding of the mapping relationship between the client's exit IP and the remote debugging IP.
[0052] Optionally, the mapping information may have an expiration time, which allows users to perform remote debugging without authentication within the expiration time, and to perform remote debugging again after the expiration time.
[0053] Step 204: In response to detecting a remote debugging request sent by the client, forward the remote debugging request to the debugging port corresponding to the remote debugging address information.
[0054] In some embodiments, the execution entity may, in response to detecting a remote debugging request sent by the client, forward the remote debugging request to the debugging port corresponding to the remote debugging address information. The remote debugging request may include, but is not limited to, a remote debugging connection request and a remote debugging operation request. A remote debugging connection request may be a request to establish a remote debugging connection. A remote debugging operation request may be a request to perform a remote debugging operation. A remote debugging operation may be an operation to debug a remote service. For example, a remote debugging operation may include, but is not limited to, at least one of the following: setting a breakpoint, continuing program execution, entering a function, aborting and exiting, and printing the value of a variable. When the remote debugging request is a remote debugging connection request, the remote debugging request may be a TCP request.
[0055] In some optional implementations of certain embodiments, the execution entity may, in response to detecting a remote debugging request sent by the client, forward the remote debugging request to the debugging port corresponding to the remote debugging address information by the following steps:
[0056] The first step is to read the egress address information from the remote debugging request detected by the aforementioned client. In practice, when the remote debugging request is a remote debugging connection request, the executing entity can extract the source IP address as the egress address information from the IP header of the TCP segment of the remote debugging request.
[0057] The second step is to determine the remote debugging address information bound to the read exit address information. In practice, the aforementioned execution entity can determine the remote debugging address information included in the mapping relationship information containing the aforementioned exit address information.
[0058] The third step is to forward the aforementioned remote debugging request to the debugging port corresponding to the determined remote debugging address information. Thus, the executing entity can forward the request for establishing a remote debugging connection to the debugging port of the remote server to establish the remote debugging connection.
[0059] The above embodiments of this disclosure have the following beneficial effects: the remote debugging methods of some embodiments of this disclosure simplify the configuration operation of remote debugging and improve the efficiency and security of remote debugging. Specifically, the reason why the configuration operation of remote debugging is complex, inefficient, and insecure is that developers need to correctly configure the local and remote server IP and debugging port according to the remote debugging tutorial, and also need to consider the complexity and security issues of the network environment. If there are network problems, network-level load balancing is also required, resulting in a cumbersome and complex configuration. In the case of network isolation, due to network policies or firewall restrictions, direct remote debugging may not be able to be executed or may be inefficient. Since it is necessary to directly connect to the debugging port of the remote server, if the debugging port is used by other unauthorized users, it may lead to data leakage or system crash, resulting in poor security. Based on this, the remote debugging method of some embodiments of this disclosure firstly, in response to receiving the remote debugging address information input by the user on the client, performs user authentication processing based on the user's user identifier and the remote debugging address information to obtain the user authentication result. Thus, the user's permissions for the remote debugging address information can be authenticated first to determine whether the user has the right to debug the remote service corresponding to the remote debugging address information. Then, it is determined whether the remote server has opened the debugging port corresponding to the aforementioned remote debugging address information. This allows for pre-determining whether the remote server has opened the port corresponding to the remote service for the remote debugging address information. Next, in response to the determination that the remote server has opened the debugging port corresponding to the aforementioned remote debugging address information, and the aforementioned user authentication result indicates successful authentication, the proxy address information and port information are sent to the aforementioned client, enabling the client to establish a remote debugging connection and perform remote debugging based on the aforementioned proxy address information and port information. Therefore, when the remote server has opened the debugging port corresponding to the aforementioned remote debugging address information and user authentication is successful, a proxy address and port can be assigned to the client, allowing the client to communicate with the proxy server through the assigned proxy address and port. Afterwards, in response to detecting a remote debugging request sent by the aforementioned client, the remote debugging request is forwarded to the aforementioned debugging port corresponding to the aforementioned remote debugging address information. Thus, the proxy server can be used to forward the client's remote debugging request to the remote server's debugging port to achieve remote debugging. Furthermore, since remote debugging only requires the user to input the remote debugging address information on the client, eliminating the need for complex configuration by the user, the configuration operation for remote debugging is simplified. Furthermore, because the client does not perform remote debugging directly, but forwards it through the proxy server, remote debugging can still be achieved even in isolated network environments, thus preventing remote debugging from failing or becoming inefficient and improving the efficiency of remote debugging.Furthermore, because the client does not need to directly connect to the remote server's debugging port, but instead forwards the connection through a proxy server, the possibility of the debugging port being exploited by other unauthorized users is reduced, thereby improving the security of remote debugging. This simplifies the configuration process for remote debugging and improves both its efficiency and security.
[0060] Continue to refer to Figure 3 The diagram illustrates a flow 300 of some embodiments of a remote debugging method applied to a client according to the present disclosure. The remote debugging method includes the following steps:
[0061] Step 301: Receive the remote debugging address information input by the user.
[0062] In some embodiments, the execution subject of the remote debugging method (e.g. Figure 1 The terminal device shown can receive remote debugging address information input by the user. In practice, the aforementioned execution entity can display a remote debugging address information input control. This control can be a tool for inputting remote debugging address information. It can be a text input box or a drop-down selection box that displays various optional remote debugging address information corresponding to the user. The various optional remote debugging address information corresponding to the user can be determined by the proxy server using the user's user identifier. For example, the various remote debugging address information corresponding to the user can be the remote debugging address information included in the debugging permission information corresponding to the aforementioned user identifier, retrieved by the proxy server from the user information database. In practice, the aforementioned execution entity can determine the IP address entered by the user in the remote debugging address information input control as the remote debugging address information entered by the user. The aforementioned execution entity can also determine the optional remote debugging address information selected by the user from the various optional remote debugging address information as the remote debugging address information entered by the user.
[0063] Optionally, the IP address entered by the user into the text input box can also be validated for IP address format. Only IP addresses that pass the IP address format validation can be used as remote debugging address information entered by the user.
[0064] Step 302: In response to detecting a selection operation applied to the remote debugging control, the remote debugging address information is sent to the proxy server.
[0065] In some embodiments, the aforementioned execution entity may send the remote debugging address information to the proxy server in response to detecting a selection operation performed on the remote debugging control. The remote debugging control can be a control used to determine whether to establish a remote debugging connection. It should be noted that after the user enters the remote debugging address information on the client side and clicks the remote debugging control, the remote debugging operation can be performed once the connection is successfully established.
[0066] Step 303: In response to receiving the proxy address information and port information sent by the proxy server, save the proxy address information and port information as remote debugging configuration information.
[0067] In some embodiments, the execution entity may, in response to receiving the proxy address information and port information sent by the proxy server, save the proxy address information and port information as remote debugging configuration information. This remote debugging configuration information can be a configuration item in an IDEA plugin used to store remote DEBUG settings.
[0068] Step 304: Based on the remote debugging configuration information, send the remote debugging request to the proxy server, so that the proxy server forwards the remote debugging request to the debugging port corresponding to the remote debugging address information.
[0069] In some embodiments, the executing entity can send a remote debugging request to the proxy server based on the remote debugging configuration information, causing the proxy server to forward the remote debugging request to the debugging port corresponding to the remote debugging address information. The remote debugging request may include, but is not limited to, a remote debugging connection request and a remote debugging operation request. In practice, the executing entity can send a remote debugging request to the proxy server based on the proxy address information and port information included in the remote debugging configuration information, causing the proxy server to forward the remote debugging request to the remote server.
[0070] In some optional implementations of certain embodiments, the execution entity may send a remote debugging request to the proxy server based on the remote debugging configuration information through the following steps:
[0071] The first step is to send the remote debugging connection request to the aforementioned proxy server based on the remote debugging configuration information. In practice, the executing entity can send the remote debugging connection request to the aforementioned proxy server based on the proxy address information and port information included in the remote debugging configuration information, so that the aforementioned proxy server forwards the remote debugging connection request to the remote server.
[0072] The second step involves sending a remote debugging request corresponding to the detected remote debugging operation to the aforementioned proxy server. The remote debugging operation can be an action performed by the user on the client side via an IDEA plugin for remote debugging. Remote debugging operations may include, but are not limited to, at least one of the following: setting breakpoints, continuing program execution, entering a function, aborting and exiting, and printing variable values. Therefore, a remote debugging connection can be established first, followed by the remote debugging operation.
[0073] The various embodiments disclosed above have the following beneficial effects: The remote debugging methods of some embodiments of this disclosure simplify the configuration operations for remote debugging, improving the efficiency and security of remote debugging. Because remote debugging only requires the user to input the remote debugging address information on the client and start remote debugging with one click, eliminating the need for complex configuration by the user, the configuration operations for remote debugging are simplified. Furthermore, because the client does not directly perform remote debugging but forwards it through a proxy server, remote debugging can be achieved even in isolated network environments, preventing remote debugging from failing or becoming inefficient, thus improving the efficiency of remote debugging. Moreover, because the client does not need to directly connect to the debugging port of the remote server but forwards it through a proxy server, the possibility of the debugging port being exploited by other unauthorized users is reduced, thereby improving the security of remote debugging. Therefore, the configuration operations for remote debugging are simplified, and the efficiency and security of remote debugging are improved.
[0074] Further reference Figure 4 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a remote debugging system, which are similar to... Figure 2 and Figure 3 Corresponding to the method embodiments shown, this remote debugging system can be specifically applied to various electronic devices.
[0075] like Figure 4As shown, a remote debugging system 400 in some embodiments includes: a client 401, a proxy server 402, and a remote server 403. The client 401 is configured to receive remote debugging address information input by a user; in response to detecting a selection operation on a remote debugging control, send the remote debugging address information to the proxy server; in response to receiving proxy address information and port information sent by the proxy server, save the proxy address information and port information as remote debugging configuration information; and according to the remote debugging configuration information, send a remote debugging request to the proxy server, causing the proxy server to forward the remote debugging request to the debugging port corresponding to the remote debugging address information. The proxy server 402 is configured to, in response to receiving remote debugging address information input by a user on the client, perform user authentication processing based on the user's user identifier and the remote debugging address information to obtain a user authentication result; determine whether the remote server has opened the debugging port corresponding to the remote debugging address information; in response to determining that the remote server has opened the debugging port corresponding to the remote debugging address information and that the user authentication result indicates successful authentication, send the proxy address information and port information to the client, enabling the client to establish a remote debugging connection and perform remote debugging based on the proxy address information and port information; in response to detecting a remote debugging request sent by the client, forward the remote debugging request to the debugging port corresponding to the remote debugging address information; the remote server 403 is configured to provide remote services.
[0076] It is understandable that the client 401 described in the remote debugging system 400 is similar to the reference... Figure 3 The steps in the described method correspond to each other. The proxy server 402 described in this remote debugging system 400 is consistent with the reference... Figure 2 The steps in the described method correspond to each other. Figure 4 The dashed line connecting client 401 and remote server 403 indicates indirect communication and interaction between them. Therefore, the operations, features, and beneficial effects described above also apply to the remote debugging system 400 and its constituent terminals, and will not be repeated here.
[0077] The following is for reference. Figure 5 It illustrates an electronic device 500 suitable for implementing some embodiments of the present disclosure (e.g., Figure 1 A schematic diagram of the structure of a server or terminal device. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0078] like Figure 5As shown, the electronic device 500 may include a processing unit 501 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0079] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 5 Each box shown can represent a device or multiple devices as needed.
[0080] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 509, or installed from storage device 508, or installed from ROM 502. When the computer program is executed by processing device 501, it performs the functions defined in the methods of some embodiments of this disclosure.
[0081] It should be noted that, in some embodiments of this disclosure, the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0082] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0083] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: upon receiving remote debugging address information input by a user on a client, perform user authentication processing based on the user's user identifier and the remote debugging address information, and obtain a user authentication result; determine whether the remote server has opened the debugging port corresponding to the remote debugging address information; upon determining that the remote server has opened the debugging port corresponding to the remote debugging address information, and that the user authentication result indicates successful authentication, send proxy address information and port information to the client, causing the client to establish a remote debugging connection and perform remote debugging based on the proxy address information and the port information; and upon detecting a remote debugging request sent by the client, forward the remote debugging request to the debugging port corresponding to the remote debugging address information.
[0084] Alternatively, the electronic device may: receive remote debugging address information input by the user; in response to detecting a selection operation applied to the remote debugging control, send the remote debugging address information to the proxy server; in response to receiving the proxy address information and port information sent by the proxy server, save the proxy address information and port information as remote debugging configuration information; and according to the remote debugging configuration information, send a remote debugging request to the proxy server, causing the proxy server to forward the remote debugging request to the debugging port corresponding to the remote debugging address information.
[0085] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0086] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0087] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0088] Some embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements any of the remote debugging methods described above.
[0089] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A remote debugging method, applied to a proxy server, comprising: In response to receiving remote debugging address information input by the user on the client, user authentication is performed based on the user's user identifier and the remote debugging address information to obtain the user authentication result; Determine whether the remote server has enabled the debug port corresponding to the remote debug address information; In response to determining that the remote server has opened the debugging port corresponding to the remote debugging address information, and that the user authentication result indicates that the authentication is successful, the proxy address information and port information are sent to the client, so that the client can perform remote debugging connection and remote debugging based on the proxy address information and the port information; In response to detecting a remote debugging request sent by the client, the remote debugging request is forwarded to the debugging port corresponding to the remote debugging address information.
2. The method of claim 1, wherein, Before forwarding the remote debugging request to the debugging port corresponding to the remote debugging address information in response to detecting the remote debugging request sent by the client, the method further includes: The remote debugging address information and the client's exit address information are bound together.
3. The method of claim 2, wherein, The step of forwarding the remote debugging request to the debugging port corresponding to the remote debugging address information in response to detecting the remote debugging request sent by the client includes: In response to detecting a remote debugging request from the client, the exit address information is read from the remote debugging request; Determine the remote debugging address information bound to the read exit address information; The remote debugging request is forwarded to the debugging port corresponding to the determined remote debugging address information.
4. The method of claim 1, wherein, The step of performing user authentication based on the user's user identifier and the remote debugging address information to obtain the user authentication result includes: Obtain permission information corresponding to the user identifier and the remote debugging address information; The permission information is determined as the user authentication result.
5. A remote debugging method, applied to a client, comprising: Receive remote debugging address information input by the user; In response to detecting a selection operation applied to the remote debugging control, the remote debugging address information is sent to the proxy server; In response to receiving the proxy address information and port information sent by the proxy server, the proxy address information and port information are saved as remote debugging configuration information; Based on the remote debugging configuration information, the remote debugging request is sent to the proxy server, so that the proxy server forwards the remote debugging request to the debugging port corresponding to the remote debugging address information.
6. The method of claim 5, wherein, The step of sending a remote debugging request to the proxy server according to the remote debugging configuration information includes: Based on the remote debugging configuration information, a remote debugging connection request is sent to the proxy server; In response to the detection of a remote debugging operation, a remote debugging request corresponding to the remote debugging operation is sent to the proxy server.
7. A remote debugging system, comprising: The client is configured to perform the method described in any one of claims 5-6; The proxy server is configured to perform the method described in any one of claims 1-4; The remote server is configured to provide remote services.
8. An electronic device, comprising: One or more processors; Storage device, on which one or more programs are stored, When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-4 or 5-6.
9. A computer readable medium having stored thereon a computer program, wherein, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-4 or 5-6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-4 or 5-6.