Sign inSign up

bibica/microsocks-v2

By bibica

โ€ขUpdated over 1 year ago

MicroSocks v2 โ€” SOCKS5 proxy with bandwidth control

Image
0

1.4K

bibica/microsocks-v2 repository overview

Here is the full English translation of your document:


โ MicroSocks v2 โ€” SOCKS5 Proxy with Bandwidth Control

MicroSocks v2 is an upgraded version of microsocksโ , integrated with the tc (Traffic Control) tool to directly limit upload and download speeds inside the container.

This solution is ideal when you:

  • Want to assign a dedicated SOCKS5 proxy to each user via Docker.
  • Need to restrict users from consuming too much bandwidth.
  • Want to quickly deploy a proxy on a VPS or containerized infrastructure.

โ ๐Ÿš€ Quick Installation

Run the automatic script:

wget -qO microsocks_v2.sh https://go.bibica.net/microsocks_v2 && bash microsocks_v2.sh

The script handles everything automatically. You can rerun the script to create multiple accounts or change the download/upload limits for each account.


โ ๐Ÿ›  Manual Installation

Create a compose.yml file:

services:
  account1:
    image: bibica/microsocks-v2
    container_name: account1
    restart: always
    ports:
      - "10001:1080"  # Host:Container port
    cap_add:
      - NET_ADMIN     # Required to run tc, modprobe, ip inside the container
    environment:
      - PORT=1080
      - AUTH_ONCE=true
      - QUIET=true
      - USERNAME=account1
      - PASSWORD=account1
      - DOWNLOAD_RATE=10Mbps
      - UPLOAD_RATE=10Mbps
    logging:
      driver: "none"

Start the container:

docker compose up -d

โ ๐Ÿ‘ฅ Creating Multiple Users

Just copy the services section and modify the following:

  • container_name
  • USERNAME, PASSWORD
  • ports
  • (optional) DOWNLOAD_RATE, UPLOAD_RATE speeds

Example:

  account2:
    image: bibica/microsocks-v2
    container_name: account2
    ports:
      - "10002:1080"
    cap_add:
      - NET_ADMIN
    environment:
      - PORT=1080
      - USERNAME=account2
      - PASSWORD=account2
      - DOWNLOAD_RATE=20Mbps
      - UPLOAD_RATE=20Mbps
    logging:
      driver: "none"

  account3:
    image: bibica/microsocks-v2
    container_name: account3
    ports:
      - "10003:1080"
    cap_add:
      - NET_ADMIN
    environment:
      - PORT=1080
      - USERNAME=account3
      - PASSWORD=account3
      # No bandwidth limit
    logging:
      driver: "none"

โ ๐Ÿงช Test Proxy Functionality

Use curl to test the SOCKS5 proxy (pre-installed in the automated setup):

curl -x socks5h://account1:account1@localhost:10001 http://ifconfig.me

โ โš™๏ธ Supported Environment Variables

VariableDescription
PORTSOCKS5 listening port (default: 1080)
USERNAME, PASSWORDSOCKS5 authentication credentials
DOWNLOAD_RATEDownload speed limit (e.g., 10Mbps)
UPLOAD_RATEUpload speed limit
AUTH_ONCE=trueAuthenticate only once per session
QUIET=trueSuppress output logs

โ ๐Ÿงฐ System Requirements

  • Docker (>= 20.10)
  • The container must have NET_ADMIN privileges to configure bandwidth

Tag summary

Content type

Image

Digest

sha256:8224e75eaโ€ฆ

Size

6.1 MB

Last updated

over 1 year ago

docker pull bibica/microsocks-v2