Skip to content

yeoleobun/ssjava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shadowsocks Java Implementation

This is a Java implementation of the Shadowsocks protocol, a secure proxy designed to protect your internet traffic. This implementation includes both client and server components.

Features

  • SOCKS5 protocol support
  • Multiple encryption methods:
    • AES-128-GCM
    • AES-256-GCM
    • ChaCha20-Poly1305
  • Command-line interface for both client and server
  • Built with Netty for high-performance networking

Prerequisites

  • Java 21 or higher
  • Maven 3.6 or higher

Building the Project

To build the project, run the following command in the project root directory:

mvn clean package

This will compile the code and create executable JAR files for both the client and server components in their respective target directories.

Running the Server

After building the project, you can run the server with:

java -jar server/target/server-1.0-SNAPSHOT.jar --password <your-password> --method <encryption-method>

Or using Maven:

cd server
mvn exec:java

Server Command-line Options

  • -p, --password: (Required) The password used for encryption
  • -m, --method: (Required) The encryption method to use (AES_128_GCM, AES_256_GCM, CHACHA20_POLY1305)
  • -l, --listen: (Optional) The port to listen on (default: 8388)
  • -h, --help: Show help message
  • -V, --version: Display version information

Running the Client

After building the project, you can run the client with:

java -jar client/target/client-1.0-SNAPSHOT.jar --server <server-address:port> --password <your-password> --method <encryption-method>

Or using Maven:

cd client
mvn exec:java

Client Command-line Options

  • -s, --server: (Required) The server address in the format 'host:port' (e.g., 127.0.0.1:8388)
  • -p, --password: (Required) The password used for encryption
  • -m, --method: (Required) The encryption method to use (AES_128_GCM, AES_256_GCM, CHACHA20_POLY1305)
  • -l, --listen: (Optional) The local port to listen on (default: 1080)
  • -h, --help: Show help message
  • -V, --version: Display version information

Usage Example

  1. Start the server:

    java -jar server/target/server-1.0-SNAPSHOT.jar --password mySecretPassword --method AES_256_GCM --listen 8388
  2. Start the client:

    java -jar client/target/client-1.0-SNAPSHOT.jar --server example.com:8388 --password mySecretPassword --method AES_256_GCM --listen 1080
  3. Configure your applications to use the SOCKS5 proxy at 127.0.0.1:1080

Project Structure

  • client/: The Shadowsocks client implementation
  • server/: The Shadowsocks server implementation
  • common/: Shared code between client and server (encryption, protocol handling, etc.)

Development

To contribute to the project, you can import it as a Maven project in your favorite IDE.

Running Tests

mvn test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages