Class IPRestrictedSocket

java.lang.Object
java.net.Socket
org.ametys.core.util.IPRestrictedSocket
All Implemented Interfaces:
Closeable, AutoCloseable

public class IPRestrictedSocket extends Socket
A socket implementation that will block connection to a set of IP address
  • Constructor Details

    • IPRestrictedSocket

      public IPRestrictedSocket(Pattern pattern)
      Create a socket that block connection to a set of IP address.
      Parameters:
      pattern - a regex to match against IP address (v4 or v6). Any address that matches the regex will be block.
    • IPRestrictedSocket

      public IPRestrictedSocket(Pattern pattern, Proxy proxy)
      Create a socket that block connection to a set of IP address
      Parameters:
      pattern - a regex to match against IP address (v4 or v6). Any address that matches the regex will be block.
      proxy - the kind of proxy to use
  • Method Details