Network Proxy in WeChat Browser
The website we developed targets specific user groups. For user convenience, we implemented IP login, meaning users can directly log in just by accessing our webpage in a specific network environment. However, we found that when users access our webpage through WeChat browser, but in the same network environment, using mobile browsers doesn’t have this issue.
First, facing this situation - IP login not working, the only possibility is that the IP address changed. I used WeChat to access a test page on our site (IP and UA header information will be displayed), which shows the user’s actual IP. I found the IP had changed, so there’s only one possibility – WeChat is using network proxy!!!
WeChat IP Proxy
I used my Android phone Meizu Note 5
and iPhone iPhone 6
WeChat clients to access the problematic webpage, obtaining corresponding IP address information. The results are as follows:WeChat doesn't proxy all sites
.
Explanation:
- IP is the IP obtained by the backend through request information, i.e., the client’s real IP
- IPS is X-Forwarded-For, which records the proxy IP information that the client connection went through to reach the web server
WeChat on Google Play
Since the iOS version of WeChat has no proxy, while the Android version has proxy for some sites, with this difference, likely because Apple is strict, it’s easy to think about the international version of WeChat, since Google Play Store is also very strict. So, I downloaded WeChat app from Google Store, accessed the website, and found it’s consistent with iOS - no proxy IP issues exist.
Conclusion
- There’s a difference between WeChat Android and iOS versions - iOS version doesn’t have proxy IP issues
- WeChat Android version accesses different sites differently - accessing site A, IP remains unchanged; accessing site B, IP is proxied, and the proxy field itself doesn’t add hop IP information
- WeChat client downloaded from Google Play has no proxy issues when accessing any website, consistent with iOS WeChat
- Domestic WeChat Android version performs network proxy, and doesn’t put proxy information in
X-Forwarded-For
, meaning the server side cannot get the client’s real IP
As for which sites WeChat targets for network proxy, this would need direct communication with WeChat customer service. Simply testing to find patterns is time-consuming and meaningless.