I keep getting connection refused on the client

I get this error on my client

GET http://localhost:3030/sockjs/info?cb=8oip8d2q9z net::ERR_CONNECTION_REFUSED

I tried stashing my changes but it is still happening. I also tried checking to see if something was blocking port 3030 with sudo lsof -i :3030. Nothing shows up. There’s no server errors either

Has anyone experienced this before? Anyone know a solution?

And is your meteor really running on 3030? cause it is not default

Nah, I ran it on port 3000. The 3030 shows up in the network tab though.

interesting, I still get this when i shutdown server side

GET http://localhost:3000/sockjs/info?cb=0fqb2nk1si net::ERR_CONNECTION_REFUSED

Have you tried adding the --port flag to listen to 3030 when you start up meteor?

> meteor --port 3030

Also, how are you deploying your app? Through mup?

Yeah I just tried that and it seems to fix the web socket problem… Why would this be happening though? Kinda curious

For some reason, your client was listening for the server on port 3030, but your server was running on port 3000. So, by having your server run on the same port as the client, they can talk to each other. That is all I can figure was wrong, but I can not explain why your client was listening on port 3030.

Derp. Found the problem. And it was a stupid mistake

I almost always use meteor-ddp-analyzer to get a good idea of how my DDP connections are working. However, I wasn’t using it currently but still had the environment variable exported.

$ echo $DDP_DEFAULT_CONNECTION_URL
http://localhost:3030
2 Likes

Yes, it is fun with 3 terminals from previous days each different variable set

Than you close your one, it jumps to other and bang, all wrong :smiley:

1 Like

Thanks it solved my issue