Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Code listens to random port when opened #73719

Closed
DavSanchez opened this issue May 14, 2019 · 2 comments
Closed

VS Code listens to random port when opened #73719

DavSanchez opened this issue May 14, 2019 · 2 comments
Assignees
Labels
*dev-question VS Code Extension Development Question

Comments

@DavSanchez
Copy link

  • VSCode Version: 1.33.1
  • OS Version: macOS 10.14.4

I have realised that some VS Code functionality seems to begin listening to a random port whenever it's opened. Apparently it is for WebSockets requests.

$ sudo lsof -PiTCP -sTCP:LISTEN
COMMAND     PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
# Other process
# Other process
Code\x20H 14404 ****   37u  IPv4 0xcc5f858ae8e4fa6d      0t0  TCP localhost:27741 (LISTEN)

$ ps -p 14404
  PID TTY           TIME CMD
14404 ??         0:04.32 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --nolazy --inspect=27741 /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-fork --type=extensionHost

My question is, is this normal? I thought it could be due to some extension, but I tried disabling all extensions and reloading VS Code and the issue persists.

Does this issue occur when all extensions are disabled?: Yes

Thank you!

@DavSanchez DavSanchez changed the title VS Code listens to random port VS Code begins listening to random port whenever it's opened May 14, 2019
@DavSanchez DavSanchez changed the title VS Code begins listening to random port whenever it's opened VS Code listens to random port when opened May 14, 2019
@jrieken jrieken self-assigned this May 14, 2019
@jrieken
Copy link
Member

jrieken commented May 14, 2019

Yeah, that's the extension host process and it enabling the inspector protocol. We use this to profile extensions when the extension host process becomes unresponsive.

You can double check by looking at this message on the dev console. It should be the same port as lsof prints.

Screenshot 2019-05-14 at 09 28 45

@jrieken jrieken added the *dev-question VS Code Extension Development Question label May 14, 2019
@vscodebot
Copy link

vscodebot bot commented May 14, 2019

We have a great developer community over on slack where extension authors help each other. This is a great place for you to ask questions and find support.

Happy Coding!

@vscodebot vscodebot bot closed this as completed May 14, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*dev-question VS Code Extension Development Question
Projects
None yet
Development

No branches or pull requests

2 participants