code: private void setConnector(final SocketConnector connector) {
          if (connector == null) {
              throw new NullPointerException("connector cannot be null");
          }
  
          this.connector = connector;
          String className = ProxyFilter.class.getName();
  
          // Removes an old ProxyFilter instance from the chain
          if (connector.getFilterChain().contains(className)) {
              connector.getFilterChain().remove(className);
          }
  
          // Insert the ProxyFilter as the first filter in the filter chain builder        
          connector.getFilterChain().addFirst(className, proxyFilter);
      }
docs: Sets the {@link SocketConnector} to be used for connections
  to the proxy server.
  
  @param connector the connector to use