code: public static void install() throws IOException {
          
          try {
              Field factoryField = Socket.class.getDeclaredField("factory");
              factoryField.setAccessible(true);
              SocketImplFactory currentSocketImplFactory = (SocketImplFactory) factoryField.get(null);
              if (null == currentSocketImplFactory || !SnifferSocketImplFactory.class.equals(currentSocketImplFactory.getClass())) {
                  factoryField.set(null, null);
                  Socket.setSocketImplFactory(new SnifferSocketImplFactory());
                  previousSocketImplFactory = currentSocketImplFactory;
              }
          } catch (IllegalAccessException e) {
              throw new IOException("Failed to initialize SnifferSocketImplFactory", e);
          } catch (NoSuchFieldException e) {
              throw new IOException("Failed to initialize SnifferSocketImplFactory", e);
          }
  
      }
docs: Backups the existing {@link SocketImplFactory} and sets the {@link SnifferSocketImplFactory} as a default
  @see #uninstall()
  @throws IOException if failed to install {@link SnifferSocketImplFactory}
  @since 3.1