-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Could not connect to websocket #640
Comments
I am seeing the same issue. Has there been any update about this issue? |
Hmm, and if you play with https://github.com/99designs/gqlgen/pull/529/files |
I tried playing with that function, but it seems to have the same behavior no matter what I set as the duration. I tried 40 then 100 (seconds) and got the same result: after about 30 seconds it would lose the connection after sending a 'ka' message (I saw the 'ka' in the messages section in the inspector for the request). |
Has anyone figured this out? I'm having the same issue. After 1 minute if no messages transmitted the error pops out:
|
I was not able to figure it out, from the code it looks like it should work, but it seems to timeout. I had to setup my own Websocket handling code using Gorilla Websocket library, while it would have been nice to use subscriptions with the GQLGen library, using the Gorilla Websocket library is working out well so far. |
I've figured out that the problem with my code was having WebSocket and GraphQL handler on the same URL pattern. My current code:
I didn't dive into GqlGen code or Gorilla code but it might be Gorilla problem. Should be fairly easy to check. |
const DefaultConnectionKeepAlivePingInterval = 25 * time.Second |
It's some protocol details that needs to be sorted. I could not use
|
I solved the issue by lowering down the keepalive interval to 10s |
This can be solved by setting
Still, get the issue in secure connection(i.e. Not work in wss://connection-URL) |
I think this was fixed by #820. Please reopen if not |
Seems like its still happening. Testing with the chat example (not Gin), anything higher than Testing with my own app (Gin), I have the same experience. It seems you need |
Could you please add a recipe in https://gqlgen.com/ on how to use with Gin and gqlgen for subscriptions |
I'm on 0.10.2 and I still need the option |
could you please update on this |
I might have a similar issue #1150. It seems like when it's time to write a message, gorilla websockets returns an error indicating |
Same issue here. I've tried a few of the above solutions, and what worked for me was Would probably be a good idea to update this. |
Had same issue, only the following work-around works. We need to have a better solution:
|
Hi. The same problem. I have middleware which go to user service and auth user by token. gqlgen version v0.11.3
|
Gqlgen can't do much about it. Playground (used by gqlgen) uses a subscription client from this package. It has built-in inactivity timeout (for prisma playground it's 20 seconds). The only way to fix it is to set KeepAlivePingInterval between 1 and 15 seconds. |
Still the same issue in 0.13.0. Only for secure ( |
Still seeing this issue as well in 0.13.0. This should probably be reopened. |
Same issue! Is there a way to fix it? I have tried many different timeouts, none work. |
Could not connect to websocket endpoint wss://127.0.0.1:4000/api/query. Please check if the endpoint url is correct.
Im using mux.
resolver.go
main.go
I can push message via websocket tunnel as you can see on the attached screenshot, but it closed after about 10-15 seconds.
The text was updated successfully, but these errors were encountered: