Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

com.github.mike10004:fengyouchao-sockslib

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.github.mike10004:fengyouchao-sockslib

A Java library for SOCKS5 client and SOCKS5 server

  • 1.0.6
  • Source
  • Maven
  • Socket score

Version published
Maintainers
2
Source

SocksLib Build Status Coverage Status Coverity Scan Build Status

SocksLib is a Java library for SOCKS5 protocol.

See Java API Documentation

See Wiki Page (Chinese)

If you are looking for a SOCKS5 server instead of a SOKCS5 library, I hope Esocks can help you.

References

Features

Client

  • TCP proxy
  • UDP proxy
  • Bind
  • Anonymous authentication
  • USERNAME/PASSWORD authentication
  • Proxy chain

Server

  • TCP proxy
  • UDP proxy
  • Bind
  • Anonymous authentication
  • USERNAME/PASSWORD authentication
  • Proxy chain
  • Black or white IP lists for clients

Quick start

Environment
  • JDK 8+
Dependencies

You should put following libraries in your project's CLASSPATH:

SOCKS5 Client

CONNECT
    SocksProxy proxy = new Socks5(new InetSocketAddress("localhost",1080));
    Socket socket = new SocksSocket(proxy, new InetSocketAddress("whois.internic.net",43));

Connect SOCKS5 server using SSL connection

    SSLConfigurationBuilder builder = SSLConfigurationBuilder.newBuilder();
    builder.setTrustKeyStorePath("client-trust-keystore.jks");
    builder.setTrustKeyStorePassword("123456");
    SocksProxy proxy = new SSLSocks5(new InetSocketAddress("localhost", 1081), builder.build());
    Socket socket = new SocksSocket(proxy, new InetSocketAddress("whois.internic.net",43));
BIND
    SocksServerSocket serverSocket = new SocksServerSocket(proxy, inetAddress,8080);
    InetAddress bindAddress = serverSocket.getBindAddress();
    int bindPort  = serverSocket.getBindPort();
    Socket socket = serverSocket.accept();
UDP ASSOCIATE
     DatagramSocket socket = new Socks5DatagramSocket(proxy);

SOCKS5 Server

     SocksProxyServer proxyServer = SocksServerBuilder.buildAnonymousSocks5Server(); 
     proxyServer.start();// Creat a SOCKS5 server bind at port 1080

SSL socks server

    SSLConfigurationBuilder builder = SSLConfigurationBuilder.newBuilder();
    builder.setKeyStorePath("server-keystore.jks");
    builder.setKeyStorePassword("123456");
    builder.setClientAuth(false);
    socksProxyServer = SocksServerBuilder.buildAnonymousSSLSocks5Server(1081, builder.build());
    socksProxyServer.start();

FAQs

Package last updated on 01 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc