Detect false offline when using VPN
Closed this issue · 9 comments
Hi,
The package works great with regular internet connection. However, when using VPN, the package detect back and forth offline and online. Any update to fix the issue ?
Thank You
Adalidda.com
ah interesting! i hadn't seen that before. are you using polling?
Yes, my webapp used apollo graphql mongodb. But I just discover that the above issue is specific to Free Vpn plug in for Google Chrome. If I used SoftEther VPN client manager, the package works fine under VPN.
Thank You for this great package.
Adalidda.com
Thank you for looking into it! Could you post a link to the specific Chrome plug-in? That way other users can find this discussion.
Plug in name: Free VPN - the fastest VPN in the house
The link to the plug in is https://chrome.google.com/webstore/detail/free-vpn-the-fastest-vpn/enaobbodnmbpecahhojidoiblhmnohef
I think that you should make the detect timeout an optional parameter, so we can choose after how many ms, the online or offline should be activate. The current timeout seems too fast so that may generate false detection of offline.
Thank You
Adalidda.com
@chrisbolin I might facing the same issue.
It keeps going on and off.
However, I am getting this error message, everytime it checks for connection (my interval is set to 3000 ms)
Access to XMLHttpRequest at 'https://ipv4.icanhazip.com/' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I'm having the same issue with pinging https://google.com
on work environments. Can we have configs to pass CORS
headers ? or mode: 'no-cors'
?
cc @chrisbolin
@Satsh24 , can you confirm the presence of that header prop resolves your problem? Possibly fork and confirm this? I can't repro when I am hitting the domain from my http://localhost:3000
. Are you using a VPN like the others below? I believe this may be causing your CORS issue
If this is resolved by the appropriate cors header, I am more than happy to include the header props in V3!
@cwise89 No that didn’t work out well for me. My issue is different, I have restrictions to hit outside api’s so I couldn’t use this package. But I do think it will be good if we can have an async method accepted as props so we can do whatever we want in that async method. Or accept the url as a prop.
Or accept the url as a prop.
Done! :) https://github.com/cwise89/react-detect-offline#props