apidash icon indicating copy to clipboard operation
apidash copied to clipboard

Feature request: Websocket Support

Open 4F2E4A2E opened this issue 1 year ago • 11 comments

I would love to have Websocket support. Is this on your roadmap?

4F2E4A2E avatar Apr 22 '23 19:04 4F2E4A2E

Hi @4F2E4A2E, Thank you for raising this feature request. We do have Websocket support in our roadmap.

ashitaprasad avatar Apr 22 '23 23:04 ashitaprasad

WebSocket Implementation Request Model:

The request model for implementing WebSocket should include the following parameters:

  • url
  • name
  • description
  • requestTabIndex
  • requestHeaders
  • requestParams
  • requestBody
  • requestBodyContentType

Additionally, each request model should have a corresponding responseModel to capture the received response from the sent requests.

Response Handling:

We can maintain a list of such requests, which can be displayed in the response pane alongside the corresponding response. Each response should consist of:

  • message
  • status

Interface Sketch:

For a visual representation, please refer to the rough sketch of the interface. I have also included some more details in the sketch: Sketch

mmjsmohit avatar Dec 26 '23 09:12 mmjsmohit

Hi @mmjsmohit, Thanks for taking up this issue and posting and initial draft of implementation details. Did you get a chance to take a look at other GUI API clients to understand the different features people use to test WebSocket?

ashitaprasad avatar Dec 29 '23 03:12 ashitaprasad

Yes, @ashitaprasad! I have looked at Postman and Thunder Client. Are there any other tools that I should check out?

mmjsmohit avatar Feb 21 '24 20:02 mmjsmohit

@ashitaprasad @animator Should I go ahead with the implementation outlined in the above sketch?

mmjsmohit avatar Feb 24 '24 11:02 mmjsmohit

Yes @mmjsmohit You can go ahead and draft an initial implementation as shown in the sketch you provided. Untitled-2024-02-24-2211-2

animator avatar Feb 24 '24 16:02 animator

@animator @ashitaprasad I made respectable progress in solving the issue. During the process, I realized that the response models for WebSocket and HTTP requests differ. Should I create new models for each protocol?

mmjsmohit avatar Feb 26 '24 05:02 mmjsmohit

Yes @mmjsmohit the request and response models for WebSocket will be different. You need to create a new folder inside models for websocket and keep the relevant models inside it.

ashitaprasad avatar Feb 26 '24 13:02 ashitaprasad

@animator @ashitaprasad I made respectable progress in solving the issue. During the process, I realized that the response models for WebSocket and HTTP requests differ. Should I create new models for each protocol?

Sorry @mmjsmohit, I did not see your message as I was already playing with the implementation. I opened up a PR with a working example and some explanation.

sebastianbuechler avatar Feb 26 '24 21:02 sebastianbuechler

@animator @ashitaprasad I made respectable progress in solving the issue. During the process, I realized that the response models for WebSocket and HTTP requests differ. Should I create new models for each protocol?

Sorry @mmjsmohit, I did not see your message as I was already playing with the implementation. I opened up a PR with a working example and some explanation.

I have also already implemented the whole feature and updated @animator and @ashitaprasad on Discord about the same.

Please let me know if I should open a PR or not.

mmjsmohit avatar Feb 26 '24 22:02 mmjsmohit

@mmjsmohit, you can go ahead and raise a PR.

ashitaprasad avatar Feb 26 '24 23:02 ashitaprasad