Skip to content

Cannot establish communication from custom client #1740

Description

@srgjc

I would like to communicate with debugpy from a custom client I am building over tcp locally.
For this I run python -m debugpy --listen 5678 ./script.py. (with or without --wait-for-client does not make a difference)
When listening to this port I get this response:

Content-Length: 137

{"seq": 1, "type": "event", "event": "output", "body": {"category": "telemetry", "output": "ptvsd", "data": {"packageVersion": "1.8.8"}}}Content-Length: 139

{"seq": 2, "type": "event", "event": "output", "body": {"category": "telemetry", "output": "debugpy", "data": {"packageVersion": "1.8.8"}}}Content-Length: 189

{"seq": 3, "type": "event", "event": "debugpySockets", "body": {"sockets": [{"host": "127.0.0.1", "port": 5679, "internal": false}, {"host": "127.0.0.1", "port": 60323, "internal": true}]}}

Then I establish a connection to the port marked as internal and get the following request:

Content-Length: 168

{"seq": 1, "type": "request", "command": "pydevdAuthorize", "arguments": {"debugServerAccessToken": "76cec100048a7be9dc4f3195cefcf8d8687e56cde72ae065587cfc6ac659f1b4"}}

After looking at the source code I found how the json response should look like and sent this: (As for the token, I saw in the source it should match the server token, this might be wrong though...)

{"seq":"1","type":"response","request_seq":"1","success":true,"command":"pydevdAuthorize","body":{"clientAccessToken":"76cec100048a7be9dc4f3195cefcf8d8687e56cde72ae065587cfc6ac659f1b4"}}

After this I do not get a response.
Sending requests to the external ports also results in no reaction.
What is the correct way of establishing communication with debugpy?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

needs reproIssue has not been reproduced yet

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions