'How can I send data via Websocket from a VSCode extension

I would like to send data via Websocket from an VSCode extension. Is there a builtin websocket facility or should I import the package "ws" or else?



Solution 1:[1]

used ws package, which sadly is not in ES6 module format but otherwise does its job.

Solution 2:[2]

You can use the ws package, here is an example from the official samples repository: https://github.com/microsoft/vscode-extension-samples/blob/main/lsp-log-streaming-sample/client/src/extension.ts

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 citykid
Solution 2 navigaid