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

Add option to Skip Headers in StreamMessage(Producer/Consumer) #189

Closed
cdietrich opened this issue May 2, 2018 · 5 comments
Closed

Add option to Skip Headers in StreamMessage(Producer/Consumer) #189

cdietrich opened this issue May 2, 2018 · 5 comments

Comments

@cdietrich
Copy link
Contributor

It would be nice to have an option to skip Headers in StreamMessage(Producer/Consumer) to be able to directly talk to a client using https://github.com/TypeFox/vscode-ws-jsonrpc (e.g. https://github.com/TypeFox/monaco-languageclient)

in the current state this wont work cause the client does not produce/expect the headers sent via the protocol

see TypeFox/vscode-ws-jsonrpc#6

@m-bobrowicz
Copy link

Same here, currently we are using a workaround and adding the headers manually, but it's far from ideal.

@spoenemann
Copy link
Contributor

Skipping headers in StreamMessageProducer / StreamMessageConsumer doesn't make any sense because then you don't know when a message ends in the byte stream. For your use case, you would need specialized implementations of MessageProducer / MessageConsumer that handle messages as individual Strings instead of reading / writing byte streams. The current Launcher API doesn't support that, but you're free to wire up such a thing yourself, just have a look at the code of Launcher.Builder.

@cdietrich
Copy link
Contributor Author

yes. but basically everyone who uses websockets has to do that. so why to do it 100 times if it can be done once

@jonahgraham
Copy link
Contributor

See PR #211 - it is @juliandolby starting point of websocket support for LSP4J.

@spoenemann
Copy link
Contributor

While implementing #314 I realized that there's no use in such an option to skip headers, since that reduces the message consumer / producer to simply invoking the MessageJsonHandler.

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

No branches or pull requests

4 participants