Skip to content

Conversation

@aleixq
Copy link
Contributor

@aleixq aleixq commented Nov 17, 2021

Recovering the pull request done by @staticglobal in #237 , it does what was doing but refactoring code to be used in v2 .

Quoting original contribution:

As documented here: https://xdebug.org/docs-dbgp.php#just-in-time-debugging-and-debugger-proxies

Defines two new config parameters:

* proxy_host (default '')

* proxy_port (default 9001)

If both options are non-empty, the Connection class does a few new things at the beginning and end of our session.

New workflow when using a proxy is:

* VIM listens for debugger connections on local IP and port X (default=9000) like always

* VIM makes a connection to the proxy server on port Y (default=9001)

* VIM sends a "proxyinit" command, which includes ide_key and the port we are listening on (X)

* Proxy registers our IP/port with our ide_key and sends an XML response

* VIM processes the XML response and disconnects

* VIM starts the usual 20s wait for debugger connection

* debuggers are all hard-coded to connect to the proxy for debugging sessions

* If a debugger connection comes into the proxy (before the VIM timeout) with our ide_key, the proxy will connect back to us on port X and copy all data back and forth between VIM and debugger.  This connection is indistinguishable from a regular debugger connection (except originating from the proxy IP instead of the remote host IP).

* When we are done, VIM makes another connection to proxy port Y and sends a "proxystop" command to un-map our ide_key

@staticglobal
Copy link

Thanks @aleixq ! Looks like #237 can be closed

Copy link
Member

@BlackIkeEagle BlackIkeEagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing this

@aleixq aleixq requested a review from BlackIkeEagle November 18, 2021 10:41
Copy link
Member

@BlackIkeEagle BlackIkeEagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, thanks

@BlackIkeEagle BlackIkeEagle merged commit 402357f into vim-vdebug:master Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants