简体   繁体   中英

Internet Connectivity type using java/jsp

I have a page named index.jsp . I need to put restriction that no one can access this page using WiFi, users who are using mobile data only can access my page. Any help will be appreciated

On the server, you just see some http-headers and the IP-Adress. The headers wont tell you anything about the connection, just what kind of browser is used.

If you find out the IP that mobile data users have (afaik each carrier uses only a limited numbers of ips for all they customers) you could check the IP against a list of well-known mobile-data-IPs. But if the carrier changes his IPs, you would lock out users.

Two points to remember here.

  • You cannot know user's connection type from Server. So Java(Jsp) wont help here.

  • Can do from fronted only.

    1) A big NO in old browsers. 2) Experimental support from html5 (works in few browsers)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM