private boolean allowedNetwork() throws SocketException {
        boolean allowed = false;
        Enumeration e = NetworkInterface.getNetworkInterfaces();

        while (e.hasMoreElements()) {
            NetworkInterface ni = (NetworkInterface) e.nextElement();

            Enumeration e2 = ni.getInetAddresses();

            while (e2.hasMoreElements()) {
                InetAddress ipad = (InetAddress) e2.nextElement();
                String ip = ipad.toString();
                if (ip.startsWith("/137.224") || ip.startsWith("/10.73") ||
                        ip.startsWith("/192.168.41")) {
                    allowed = true;
                }
            }
        }
        return allowed;
    }