Sets up a websocket proxy for any number of language servers.
Ported from wylieconlon/jsonrpc-ws-proxy (Node.js) to Rust.
Each server is run as a subprocess which is connected to by sending the client
to the URL / based on a configuration file defined locally. For example,
with the following defined as servers.yml
:
langservers:
python:
- pylsp
java:
- /bin/jdtls
- -configuration
- /config_linux
cpp:
- /usr/bin/clangd
The client could connect to ws://localhost:3000/python
to get a Python language server (the default port is 3000).
Usage:
cargo run --release -- --languageServers servers.yaml --port 3000
or
cargo build --release
target/release/lsp-proxy --languageServers servers.yaml --port 3000