Coder Social home page Coder Social logo

socks5's Introduction

License: MIT

Socks5

A C++11 socks5 proxy server based on Libevent

Feature

The Socks5 server has the following features:

  • Support for "No Auth" authentication
  • Support for "Username/Password" authentication
  • Support for the CONNECT command
  • Support both IPv4 and IPv6
  • Support aes-256-cbc encryption algorithm

Build

Build from source on Ubuntu 16.04:

# Install packages
$ sudo apt-get update && sudo apt-get install build-essential libssl-dev cmake -y

# Install Libevent
$ wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
$ tar -xzvf libevent-2.1.8-stable.tar.gz
$ cd libevent-2.1.8-stable
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig -v
$ cd ..
$ rm -r libevent-2.1.8-stable* 

# Build from source
$ git clone https://github.com/senlinzhan/socks5.git
$ cd socks5
$ git submodule update --init
$ mkdir build && cd build
$ cmake ..
$ make

# Run all unit testing
$ make test

Usage

  1. Run local server to accept all client connections:
$ ./bin/local \
    -host="0.0.0.0" \                        # local server hostname
    -port=5050 \                             # local server port
    -remoteHost="x.x.x.x" \                  # proxy server hostname
    -remotePort=6060 \                       # proxy server port
    -key=12345678123456781234567812345678    # 32 bytes random secret key
    -logtostderr                             # log messages to stderr 
  1. Run proxy server to accept connections from the local server:
$ ./bin/socks5 \
    -host="0.0.0.0" \                        # proxy server hostname
    -port=6060 \                             # proxy server port
    -key=12345678123456781234567812345678    # 32 bytes random secret key
    -username="admin"                        # username <optional>
    -password="admin"                        # password <optional>	
    -logtostderr                             # log messages to stderr 
  1. Browser connect to local server(127.0.0.1:5050) through plugins supporting socks5 proxy.

NOTE: The local server and the proxy server MUST use the same 32-bit random key.

TODO

Features that will be added in the future:

  • Support for the BIND command
  • Support for the ASSOCIATE command
  • Support other encryption algorithms

socks5's People

Contributors

senlinzhan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.