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

WebSocketProvider - full control over the socket #2562

Closed
safead opened this issue Jan 19, 2022 · 4 comments
Closed

WebSocketProvider - full control over the socket #2562

safead opened this issue Jan 19, 2022 · 4 comments
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@safead
Copy link

safead commented Jan 19, 2022

Is your feature request related to a problem? Please describe.

While using WebSocketProvider I have no idea how to control the websocket behaviour. WebSocketProvider._websocket has limited properties and methods comparing to regular WebSocket, so I can't terminate the connection in case of internet connectivity problems and re-connect when it is alive etc. More than this, I have no idea how to normally disconnect provider when no connection is required in the app.

Describe the solution you'd like
Let us full control over the provider socket to create custom re-connection logic, terminating (closing) the alive connection etc.

Additional context
The websocket limited properties (no "on", "close" and "terminate" methods):

image

@mightymatth
Copy link

I've recently thought about it and posted this comment on the related issue. As a workaround, you can see what I did.

@ricmoo
Copy link
Member

ricmoo commented Feb 3, 2022

See #2644.

@ricmoo ricmoo added enhancement New feature or improvement. minor-bump Planned for the next minor version bump. on-deck This Enhancement or Bug is currently being worked on. labels Feb 3, 2022
@ricmoo
Copy link
Member

ricmoo commented Mar 10, 2022

This should now be available in v5.6. You can now pass a WebSocket directly into a WebSocketProvider, so you can configure it however you wish.

Try it out and let me know if it works for you. :)

@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. minor-bump Planned for the next minor version bump. labels Mar 10, 2022
@ricmoo
Copy link
Member

ricmoo commented Mar 17, 2022

This was added, so I'll close it. Please re-open or create a new issue if there are any problems.

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

3 participants