问题
I need a capability to connect the debugger on fly to a remote Python server from PyCharm (my similar post, but slightly different subject). For the remote debugging PyCharm provides the lib called pydevd, but remote server must be connected to local machine with a running debug server. Actually, this isn't always possible because usually local machine has no public address.
So as a solution, I decide to make proxy for socket connections, which will link my local machine with remote server (I've tested, the proxing works). To make possible the running remote server without active debugger my proxy must store state of connected servers (is the server stopped on breakpoint; remove all breakpoints when debugger has been disconnected) and mock connects/disconnect messages.
The main problem is that I can't find any specification for pydevd protocol.
All what I have found are:
- handshake messages (two messages with code
501
, after that unknown messages with codes122
146
101
) - message with code
111
to set breakpoint - message with code
112
to unset breakpoint - message with code
116
to send changes of stdout
If anyone had the same problem, please, help me to solve it or help me to find the specification for pydevd protocol.
回答1:
There is no complete specification for the pydevd protocol. However, the implementation is open-source, and a brief description of the protocol can be found in the source code.
来源:https://stackoverflow.com/questions/41169047/no-pydevd-protocol-specification