thunder-client-support
thunder-client-support copied to clipboard
Add RSocket/Web Socket support
As an API developer, I often work on streaming APIs based on RSocket. It'd be useful if Thunder Client can add support for this.
I will do some research on how to implement this.
Hi @naiyerasif what client currently you are using to test rsocket?
if anyone know how to implement this in node, they can contribute to the project.
I use an internal client app that consumes a dev version of the RSocket server. Unfortunately, it is very specific to the server and needs some serious thumb-twiddling for any changes (which is why I raised this request)
There's rsocket/rsocket-js package that provides several client and server packages.
Hope to support websocket
@shenghui0779 its in roadmap
That's great !
@shenghui0779 its in roadmap
Where can I find the roadmap to get the state?
Just a basic interface to connect to a websocket with some headers would be enough for some rapid prototyping. After the connection was established just show a logging window with all incoming data (only show if it was encoded with something readable like utf-8
) and a message window where you can send (json) data.
Later some protocols like secure websockets and stuff could be added.
How about that?
Hi @UliPrantz sounds good
Can you share sample url or node project for testing.
will look into when I got it time.
@rangav basically the same as this plugin is doing it. It's called WebSocket-Client. I don't know what all the clutter with STOMP and SocketJS is but as far as I can tell STOMP is only a subprotocol which can be used once the WebSocket connection is established and SocketJS seems to be some JS library. I don't think these two things are necessary for a first little feature demo but probably can come in handy later down the road.
The project has no license means it would be illegal to use the code but at least it's a good starting point and when you ask @MoNouri97 he will probably update the license and maybe he will also agree to merge the project?!
@UliPrantz thanks for sharing info, Will look into it.
@rangav I also find out that the Chrome/Firefox dev tools offer something similar just not that conveniently usable.
const serverUrl = 'localhost:8000';
const someUriPart = 'xxxxxxx';
const socket = new WebSocket(`ws://${serverUrl}/rooms/${someUriPart}/player/`);
socket.addEventListener('open', (event) => {
console.log('WebSocket connection established.');
const message = {
value: 'key'
};
socket.send(JSON.stringify(message));
});
socket.addEventListener('message', (event) => {
console.log('Received message:', event.data);
});
socket.addEventListener('close', (event) => {
console.log('WebSocket connection closed.');
});
socket.addEventListener('error', (error) => {
console.error('WebSocket error:', error);
});
After executing this in the console tab of the chrome/firefox dev tools you can switch to the network tab - there should be a connection with the name: player/
, status: 101
, protocol: websocket
. Select it by clicking on the name and then clicking on Messages
in the newly opened tabbar. Unfortunately to send JSON message you have to execute this line socket.send(JSON.stringify(message));
in the console tab again (ofc you can use different messages) but it's really inconvenient that it isn't possible to just write json inside the Message
tab of the websocket or any other type of text data.
The different event listeners aren't needed since all of this information shows up in the Messages
tab too. It's only there to make this example work - same goes for the socket.send
inside of the first event listener.
Wrapping this in an easy to use UI would make a lot of things easier I guess.
Thanks @UliPrantz for sharing sample code.
Currently working on few other tasks, Will look into this feature next month.
This feature has been implemented and published to the marketplace. Please update to v2.19.0
.
You can see all the features released in this update https://github.com/rangav/thunder-client-support/releases/tag/v2.19.0
Please test it and let me know your feedback