Click here to Skip to main content
15,917,862 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to know whether the system has internet behind proxy?

What I have tried:


It works well when proxy is not enabled.

If proxy settings is enabled it will always return false (when internet is available or not)
Updated 24-Feb-20 23:33pm

1 solution

If you want to know whether http protocol is accessible, then test for a web request instead of a ping request. Ping is a distinct protocol from http and is often blocked by proxies.
Check Internet Connection - Stack Overflow[^]
Share this answer
kgmmurugesh 25-Feb-20 5:29am    
web request takes 20 seconds when internet is not available.
phil.o 25-Feb-20 6:27am    
Probably; because absence of service is only qualified after the request has reached its timeout.
kgmmurugesh 25-Feb-20 6:30am    
Ok. is there any way to check quickly?
phil.o 25-Feb-20 6:41am    
You could try to lower the timeout (I don't know how), but then you face an increased risk of false positives.
kgmmurugesh 25-Feb-20 6:42am    

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900