-
Notifications
You must be signed in to change notification settings - Fork 233
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
GraphQL subscription does not work reliably unless listening on 0.0.0.0 #875
Comments
It's documented here: https://www.fastify.io/docs/latest/Reference/Server/#listen. Note that we do not have the resources to support Nest.js users. Please refer to the Nest Discord channel (support) for such questions. |
@mcollina I see, thanks. I missed that doc page. However the default seems to imply that by default it uses For regular HTTP connections, the documentation seems correct. But the websocket server does NOT seem to start on my computer on I'd like to reiterate that this seems to be websocket specific. |
Are you using the latest version of Fastify? This looks like te problem we fixed in fastify/fastify#4190. I'll be happy to look into this given a simple repro, ideally just with Fastify and Fastify-websockets |
This looks like some sort of DNS or networking issue on your machine. What does localhost resolves to? |
Oh, thank you. Indeed the version of
After bumping everything, it's all good. Sorry for taking your time, and thanks for pointing me in the right direction! |
I've been migrating a NestJS app from Apollo to Mercurius and found that the GraphQL WebSocket endpoint was not working. No connection could be established.
Upon some further inspection, I found that I needed to listen specifically on an explicit IP.
I was able to get things to work initially by specifying
127.0.0.1
as the bound IP address. However, once deployed via docker, this wouldn't work properly.Instead, I need to specify
0.0.0.0
as mentioned in this comment: #838 (comment)I wonder why this is necessary. Is it a bug? If not, I haven't seen it documented anywhere.
Related:
#838
nestjs/nest#9903 (comment)
nestjs/graphql#2365
The text was updated successfully, but these errors were encountered: