// Path: src/main/java/sockslib/common/methods/SocksMethod.java
// public interface SocksMethod {
// 
//   /**
//    * method byte.
//    *
//    * @return byte.
//    */
//   int getByte();
// 
//   /**
//    * Gets method's name.
//    *
//    * @return Name of the method.
//    */
//   String getMethodName();
// 
//   /**
//    * Do method job. This method will be called by SOCKS client.
//    *
//    * @param socksProxy SocksProxy instance.
//    * @throws SocksException If there are any errors about SOCKS protocol.
//    * @throws IOException    if there are any IO errors.
//    */
//   void doMethod(SocksProxy socksProxy) throws SocksException, IOException;
// 
//   /**
//    * Do method job. This method will be called by SOCKS server.
//    *
//    * @param session Session.
//    * @throws SocksException TODO
//    * @throws IOException    TODO
//    */
//   void doMethod(Session session) throws SocksException, IOException;
// 
// }


import sockslib.client.SocksProxy;
import sockslib.common.methods.SocksMethod;
import sockslib.server.listener.PipeInitializer;
import java.io.IOException;
import java.net.InetAddress;
import java.util.Map;
import java.util.concurrent.ExecutorService;
/*
 * Copyright 2015-2025 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package sockslib.server;



/**
 * The interface <code>SocksProxyServer</code> represents a SOCKS server.
 *
 * @author Youchao Feng
 * @version 1.0
 * @date Mar 25, 2015 10:07:29 AM
 */
public interface SocksProxyServer {

  /**
   * SOCKS server default port.
   */
  int DEFAULT_SOCKS_PORT = 1080;

  /**
   * Starts a SOCKS server.
   *
   * @throws IOException If any I/O error occurs.
   */
  void start() throws IOException;

  /**
   * Shutdown a SOCKS server.
   */
  void shutdown();

  /**
   * Create an instance {@link SocksHandler}.
   *
   * @return Instance of {@link SocksHandler}.
   */
  SocksHandler createSocksHandler();

  /**
   * Initializes {@link SocksHandler}.
   *
   * @param socksHandler The instance of {@link SocksHandler}.
   */
  void initializeSocksHandler(SocksHandler socksHandler);

  /**
   * Sets the methods that socks server supports.
   *
   * @param methods The methods that SOCKS server sports.
   */
// Path: src/main/java/sockslib/common/methods/SocksMethod.java
// public interface SocksMethod {
// 
//   /**
//    * method byte.
//    *
//    * @return byte.
//    */
//   int getByte();
// 
//   /**
//    * Gets method's name.
//    *
//    * @return Name of the method.
//    */
//   String getMethodName();
// 
//   /**
//    * Do method job. This method will be called by SOCKS client.
//    *
//    * @param socksProxy SocksProxy instance.
//    * @throws SocksException If there are any errors about SOCKS protocol.
//    * @throws IOException    if there are any IO errors.
//    */
//   void doMethod(SocksProxy socksProxy) throws SocksException, IOException;
// 
//   /**
//    * Do method job. This method will be called by SOCKS server.
//    *
//    * @param session Session.
//    * @throws SocksException TODO
//    * @throws IOException    TODO
//    */
//   void doMethod(Session session) throws SocksException, IOException;
// 
// }


// Path: src/main/java/sockslib/server/SocksProxyServer.java
import sockslib.client.SocksProxy;
import sockslib.common.methods.SocksMethod;
import sockslib.server.listener.PipeInitializer;
import java.io.IOException;
import java.net.InetAddress;
import java.util.Map;
import java.util.concurrent.ExecutorService;

/*
 * Copyright 2015-2025 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package sockslib.server;



/**
 * The interface <code>SocksProxyServer</code> represents a SOCKS server.
 *
 * @author Youchao Feng
 * @version 1.0
 * @date Mar 25, 2015 10:07:29 AM
 */
public interface SocksProxyServer {

  /**
   * SOCKS server default port.
   */
  int DEFAULT_SOCKS_PORT = 1080;

  /**
   * Starts a SOCKS server.
   *
   * @throws IOException If any I/O error occurs.
   */
  void start() throws IOException;

  /**
   * Shutdown a SOCKS server.
   */
  void shutdown();

  /**
   * Create an instance {@link SocksHandler}.
   *
   * @return Instance of {@link SocksHandler}.
   */
  SocksHandler createSocksHandler();

  /**
   * Initializes {@link SocksHandler}.
   *
   * @param socksHandler The instance of {@link SocksHandler}.
   */
  void initializeSocksHandler(SocksHandler socksHandler);

  /**
   * Sets the methods that socks server supports.
   *
   * @param methods The methods that SOCKS server sports.
   */
  void setSupportMethods(SocksMethod... methods);