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

Feature/add websocket support #210

Conversation

sebastianbuechler
Copy link

@sebastianbuechler sebastianbuechler commented Feb 26, 2024

Add WebSocket support

image

This feature adds basic WebSocket support to apidash. It is according to the sketches in #15, but the headers are not yet incorporated into the web socket connection. Including the body does not make sense for WebSockets if I'm not mistaken, so we should remove it as well.

My proposal for the query params and the headers: If they get changed, the connection should be dropped and the user needs to manually reconnect, as the server connection will change. Maybe the UI should be adapted for this.

Thus open points:

  • Remove body tab
  • Include query params into WebSocketManager
  • Handle query param changes into an existing connection
  • Include headers into WebSocketManager
  • Handle header changes into an existing connection

Testing is a bit harder for WebSockets to begin with. Maybe inject an HTTP client manually to mock it?

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: please replace this line with details on why tests have not been included
  • I need help with writing tests

@sebastianbuechler
Copy link
Author

@ashitaprasad In contrast to #215 this works with the same request model and dedicated WebSocket states. This allows for simultaneous connections to WebSocket servers. Let me know if adaptions are needed or further clarification on the specs.

@animator
Copy link
Member

@sebastianbuechler Kindly make this change #307

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

Successfully merging this pull request may close these issues.

Feature request: Websocket Support
3 participants