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

gql should have a websockets-client transport #451

Open
mpegman-scwx opened this issue Nov 27, 2023 · 4 comments
Open

gql should have a websockets-client transport #451

mpegman-scwx opened this issue Nov 27, 2023 · 4 comments
Labels
type: feature A new feature

Comments

@mpegman-scwx
Copy link

python-websockets doesn't support proxies and has no intention to in the near future. We should allow for usage of a websockets-client transport to allow users to ability to run through proxies.

I plan on working on this myself. Just creating a placeholder issue to work off of, but I am willing to work with anyone else that would be interested in supporting this feature.

@leszekhanusz leszekhanusz added the type: feature A new feature label Nov 27, 2023
@leszekhanusz
Copy link
Collaborator

leszekhanusz commented Nov 27, 2023

  • Wouldn't it be better to make a new websockets transport using aiohttp as proposed by aiohttp transport should support websockets #418 instead of using adding a new websockets-client dependency?

  • Have you looked into this comment for a way to make a websocket connection through a proxy using websockets?

@mpegman-scwx
Copy link
Author

I was looking through aiohttp docs and everything there uses the async keyword. It would be nice to have a websockets option that supported proxies and didn't need event loop management.

@leszekhanusz
Copy link
Collaborator

Well, the great thing about gql is that you can use any transport (sync or async) in a sync way if you want. If you look at the default subscription example, you don't see any async code there.

And what about the method in the comment above? Can't it solve your problem?

@mpegman-scwx
Copy link
Author

It's worth to looking into, but at the moment hasn't been implemented yet. It would take me some time to familiarize myself with aiohttp (something I haven't used at all and don't know any of its internals). Looking through the subscribe() method it looks like it needs an async transport anyways, so maybe this wouldn't even integrate well.

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

No branches or pull requests

2 participants