当前位置: 首页 > 文档资料 > xdebug 中文文档 >

DBGp Proxy Tool

优质
小牛编辑
130浏览
2023-12-01

This tool allows you to proxy and route debugging request to IDEs depending on which IDE key is in use.

Installation

A binary for Linux, macOS, and Windows is available on the downloads page. You only have to download the binary, which you can then run from a command line.

Command Line Options

The following command line options are available:

-hShow this help
-i host:port
--client host:port
Specify the port to listen on for IDE (client) connections [localhost:9001].
-s host:port
--server host:port
Specify the port to listen on for debugger engine (server) connections [localhost:9000].
-vShow version number and exit

Usage

To start the client on the command line on Linux, open a shell, and then run:

./dbgpProxy

If the binary doesn't start or you get a not found message, please refer to this FAQ entry.

To start the client on the command line on Linux, open a shell, and then run:

./dbgpProxy-macos

On Windows, open a command a Command Prompt and run:

dbgpProxy.exe

In all cases, you can add the command line options as described above.

When the proxy starts, it shows some version information. It will then wait until a connection is made to it by a debugging engine (such as Xdebug):

Xdebug DBGp proxy (0.3)
Copyright 2020 by Derick Rethans
15:17:35.423 [warn] [SSL] The 'certs/fullchain.pem' file could not be found, not enabling SSL listeners
15:17:35.424 [info] [dbgpProxy] Proxy started
15:17:35.424 [info] [server] Started server server on 127.0.0.1:9000
15:17:35.424 [info] [server] Started client server on 127.0.0.1:9001

When a client registers itself with the proxy it displays the IDE Key and where to reach that client:

15:18:57.087 [info] [server] Start new client connection from 127.0.0.1:54196
15:18:57.087 [info] [proxyinit] [derickr] Added connection for IDE Key 'derickr': 127.0.0.1:9099
15:18:57.087 [info] [server] Closing client connection from 127.0.0.1:54196

At this point the client should be ready to take incoming debugging connections to its registered port (127.0.0.1:9099 in this example).

You can stop the proxy by pressing Ctrl-C in its terminal. Once all debugging connections are closed, the proxy service will stop.