-
-
Notifications
You must be signed in to change notification settings - Fork 5
Description
The proxy protocol is not well defined. One could speculate, that it follows the same line protocol as dbgp (client to server: one line, null terminated / server to client: decimal length, NULL, xml, NULL) however the implementations out there vary in implementation. This makes it hard to implement proxy support into IDEs. Some examples that I was able to find:
pydbgpproxy (Komodo, PhpStorm...) (copy https://github.com/agroszer/komodo-python-dbgp)
- request: reads up to 1024 bytes, trims/strips white space (so sending NULL or newline works)
- response: sends xml, no length or NULLs, then closes connection
https://github.com/MadridianFox/xdebug-proxy
- request: reads until NULL
- response: sends xml, no length or NULLs, then closes connection
https://github.com/mougrim/php-xdebug-proxy
- request: reads until NULL
- response: sends xml, no length or NULLs, then closes connection
https://github.com/eelf/smdbgpproxy/
- request: reads until NULL
- response: sends length NULL xml NULL, then closes connection
I believe more or less everybody uses pydbgpproxy and it's regarded as a defacto standard. The following lines should probably be changed:
The proxy should respond with a simple XML statement alerting the IDE to an error, or the success of the initialization (see section 6.5 for more details on the error element).
to
The proxy should respond with a simple XML statement alerting the IDE to an error, or the success of the initialization and disconnect to indicate all data has been transmitted (see section 6.5 for more details on the error element).
and
Once the IDE has sent this command, and received a confirmation, it disconnects from the proxy.
to
Once the IDE has sent this command, and received a confirmation, the proxy drops the connection.
I can open a PR.
Best,
Damjan