Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

WebSocketMessageReader vs Content-Length #6

Closed
cdietrich opened this issue Apr 21, 2018 · 1 comment
Closed

WebSocketMessageReader vs Content-Length #6

cdietrich opened this issue Apr 21, 2018 · 1 comment

Comments

@cdietrich
Copy link

is there a reason why WebSocketMessageReader/Writer does not support Content-Length header as StreamMessageReader/Writer and SocketMessageReader/Writer do? Not even Optional with a flag?

This implies that both server and client aggree not to need/ignore them. this wont work e.g. on LSP4J that easy.

@akosyakov
Copy link
Contributor

akosyakov commented May 2, 2018

  1. This package is agnostic to an application protocol, i.e. to LSP.
  2. jsonrpc + headers is only one possible transport for LSP: Why not use HTTP directly? microsoft/language-server-protocol#86 (comment)
  3. content-length is redundant with web sockets and introduce string encoding/decoding overhead (performance)

LSP4J should be able to support different transports by replacing MessageConsumer and MessageProducer, e.g from StreamMessageConsumer to WebSocketMessageConsumer. If not please file an issue there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants