Meteor and cloud fluctuation with xhr query loop targets
I am writing a Meteor application that has two components - a metend interend application hosted on one server and a chat application hosted on another. The chat app uses socket.io for the actual messaging (because I wanted to use redis pub-sub and this is not supported by Meteor yet), and of course sockjs for the rest.
I post two on Kubernete. Websockets run on their network IP addresses.
However, I want to use Cloudflare where websockets won't work, so I have the DISABLE_WEBSOCKETS enval variable set to 1. Also, the transports for socket.io should have just used xhr polling by default.
The only problem is this:
- When I receive conversations, the application hangs because the external web application is making a huge number of repeated "xhr" requests in the chat application.
- after a while, the chat app will be able to respond and send information in about 10 seconds, when it should be busy in less than 0.5 seconds.
- there are a huge number of sockjs xhr requests, while the number of sockjs xhr requests to the regular application interface is small.
- on development this issue does not occur even with DISABLE_WEBSOCKETS set to 1.
On Cloudflare I tried the following (from this page: https://modulus.desk.com/customer/portal/articles/1929796-cloudflare-configuration-with-meteor-xhr-polling ): - Set "Pseudo IPv4" to "Overwrite Headers "
Is there a special Meteor configuration that I need for xhr to work with cloud flair? Also, I have another service in the app, but it works great. Can socket.io interfere with sockjs in the chat service in some way?
source to share
No one has answered this question yet
Check out similar questions: