Codota Logo
sockslib.server
Code IndexAdd Codota to your IDE (free)

How to use sockslib.server

Best Java code snippets using sockslib.server (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: theotherp/nzbhydra2

@Override
public void run() {
  try {
    handle(session);
  } catch (Exception e) {
    sessionManager.sessionOnException(session, e);
    //      logger.error("SESSION[{}]: {}", session.getId(), e.getMessage());
  } finally {
    session.close();
    sessionManager.sessionOnClose(session);
    //      logger.info("SESSION[{}] closed, {}", session.getId(), session.getNetworkMonitor().toString
    //          ());
  }
}
origin: theotherp/nzbhydra2

/**
 * Calls {@link #newBuilder(Class)}  with an argument <code>Socks5Handler.class</code>;
 *
 * @return Instance of {@link SocksServerBuilder}.
 */
public static SocksServerBuilder newSocks5ServerBuilder() {
  return new SocksServerBuilder(Socks5Handler.class);
}
origin: fengyouchao/sockslib

@Override
public void addSessionListener(String name, SessionListener listener) {
 this.onCommand(name, listener);
 this.onException(name, listener);
 this.onSessionClose(name, listener);
 this.onSessionCreate(name, listener);
}
origin: theotherp/nzbhydra2

@Override
public void initializeSocksHandler(SocksHandler socksHandler) {
  socksHandler.setMethodSelector(methodSelector);
  socksHandler.setBufferSize(bufferSize);
  socksHandler.setProxy(proxy);
  socksHandler.setSocksProxyServer(this);
}
origin: theotherp/nzbhydra2

@Override
public void removeSessionListener(String name) {
  this.removeCommandListener(name);
  this.removeExceptionListener(name);
  this.removeSessionCloseListener(name);
  this.removeSessionCreateListener(name);
}
origin: theotherp/nzbhydra2

@Override
public Session newSession(Socket socket) {
  Session session = new SocksSession(++nextSessionId, socket, managedSessions);
  managedSessions.put(session.getId(), session);
  return session;
}
origin: theotherp/nzbhydra2

/**
 * This method will save user in session.
 *
 * @param session Current session.
 * @param user    user.
 */
protected void authenticationSuccess(Session session, User user) {
  session.setAttribute(USER_KEY, user);
}
origin: theotherp/nzbhydra2

/**
 * Builds a {@link SocksProxyServer} which support SOCKS5 protocol.
 * This SOCKS5 server will accept all requests from clients with no authentication.
 *
 * @return Instance of {@link SocksProxyServer}.
 */
public static SocksProxyServer buildAnonymousSocks5Server() {
  return buildAnonymousSocks5Server(DEFAULT_PORT);
}
origin: theotherp/nzbhydra2

/**
 * Creates a no authentication SOCKS5 server. The server will listen at port 1080.
 *
 * @return The instance of {@link SocksProxyServer} that supports SOCKS5 protocol.
 */
public static SocksProxyServer newNoAuthenticationServer() {
  return newNoAuthenticationServer(DEFAULT_PORT);
}
origin: theotherp/nzbhydra2

/**
 * Shutdown SOCKS5 server.
 */
public void shutdown() {
  if (server != null) {
    server.shutdown();
  }
}
origin: theotherp/nzbhydra2

/**
 * Create a USERNAME/PASSWORD authentication SOCKS5 server.
 *
 * @param users Users.
 * @return The instance of {@link SocksProxyServer} that supports SOCKS5 protocol.
 */
public static SocksProxyServer newUsernamePasswordAuthenticationServer(User... users) {
  return newUsernamePasswordAuthenticationServer(DEFAULT_PORT, users);
}
origin: fengyouchao/sockslib

@Override
public void run() {
 try {
  handle(session);
 } catch (Exception e) {
  sessionManager.sessionOnException(session, e);
  //      logger.error("SESSION[{}]: {}", session.getId(), e.getMessage());
 } finally {
  session.close();
  sessionManager.sessionOnClose(session);
  //      logger.info("SESSION[{}] closed, {}", session.getId(), session.getNetworkMonitor().toString
  //          ());
 }
}
origin: theotherp/nzbhydra2

@Override
public void addSessionListener(String name, SessionListener listener) {
  this.onCommand(name, listener);
  this.onException(name, listener);
  this.onSessionClose(name, listener);
  this.onSessionCreate(name, listener);
}
origin: fengyouchao/sockslib

@Override
public void initializeSocksHandler(SocksHandler socksHandler) {
 socksHandler.setMethodSelector(methodSelector);
 socksHandler.setBufferSize(bufferSize);
 socksHandler.setProxy(proxy);
 socksHandler.setSocksProxyServer(this);
}
origin: fengyouchao/sockslib

@Override
public void removeSessionListener(String name) {
 this.removeCommandListener(name);
 this.removeExceptionListener(name);
 this.removeSessionCloseListener(name);
 this.removeSessionCreateListener(name);
}
origin: fengyouchao/sockslib

/**
 * Calls {@link #newBuilder(Class)}  with an argument <code>Socks5Handler.class</code>;
 *
 * @return Instance of {@link SocksServerBuilder}.
 */
public static SocksServerBuilder newSocks5ServerBuilder() {
 return new SocksServerBuilder(Socks5Handler.class);
}
origin: fengyouchao/sockslib

/**
 * This method will save user in session.
 *
 * @param session Current session.
 * @param user    user.
 */
protected void authenticationSuccess(Session session, User user) {
 session.setAttribute(USER_KEY, user);
}
origin: fengyouchao/sockslib

/**
 * Builds a {@link SocksProxyServer} which support SOCKS5 protocol.
 * This SOCKS5 server will accept all requests from clients with no authentication.
 *
 * @return Instance of {@link SocksProxyServer}.
 */
public static SocksProxyServer buildAnonymousSocks5Server() {
 return buildAnonymousSocks5Server(DEFAULT_PORT);
}
origin: fengyouchao/sockslib

/**
 * Creates a no authentication SOCKS5 server. The server will listen at port 1080.
 *
 * @return The instance of {@link SocksProxyServer} that supports SOCKS5 protocol.
 */
public static SocksProxyServer newNoAuthenticationServer() {
 return newNoAuthenticationServer(DEFAULT_PORT);
}
origin: fengyouchao/sockslib

/**
 * Shutdown SOCKS5 server.
 */
public void shutdown() {
 if (server != null) {
  server.shutdown();
 }
}
sockslib.server

Most used classes

  • BasicSessionManager
    The class BasicSessionManager implements SessionManager
  • BasicSocksProxyServer
    The class BasicSocksProxyServer is a implementation of SocksProxyServer. You can build a SOCKS5 serv
  • MethodSelector
    The class MethodSelector represents a method selector. This class will select one method from the me
  • SSLSocksProxyServer
    The class SSLSocksProxyServer represents a SSL based SOCKS proxy server.
  • Session
    The class Session represents a session between client with SOCKS server. This class is simple encaps
  • Socks5Handler,
  • SocksHandler,
  • SocksProxyServer,
  • SocksProxyServerFactory,
  • SocksServerBuilder,
  • SocksSession,
  • UDPRelayServer,
  • UsernamePasswordAuthenticator,
  • Pipe,
  • PipeListener,
  • SocketPipe,
  • StreamPipe,
  • CommandListener,
  • ExceptionListener
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now