Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nskondratev/socks5-proxy-server
SOCKS5 proxy server
https://github.com/nskondratev/socks5-proxy-server
docker docker-compose self-hosted socks5 socks5-proxy
Last synced: 7 days ago
JSON representation
SOCKS5 proxy server
- Host: GitHub
- URL: https://github.com/nskondratev/socks5-proxy-server
- Owner: nskondratev
- License: apache-2.0
- Created: 2018-04-16T09:29:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-19T21:22:59.000Z (4 months ago)
- Last Synced: 2024-08-02T17:32:02.217Z (3 months ago)
- Topics: docker, docker-compose, self-hosted, socks5, socks5-proxy
- Language: JavaScript
- Homepage:
- Size: 665 KB
- Stars: 89
- Watchers: 4
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Socks5 proxy server
## Prerequisites
* Docker ([Install Docker](https://docs.docker.com/install/))## How to run
- Copy *.env.example* file: `cp .env.example .env`
- Fill in configuration: `nano .env`. Fields:
- **APP_PORT** - proxy server port (default: 54321),
- **LOG_LEVEL** - log level (default: INFO),
- **REQUIRE_AUTH** - if set to 1, anonymous users are not allowed.
- Start application: `docker compose up -d`## CLI commands
In all commands you need to call js-script in app docker container.
So you need to find out container name with proxy application by running the following command:
```bash
docker compose ps
```For example, it will be `socks5-proxy-server-proxy-1`.
In all the following commands you need to replace `socks5-proxy-server-proxy-1` with the yours container name.
### Create user
```bash
docker exec -it socks5-proxy-server-proxy-1 sh -c 'exec node scripts/create-user.js'
```### Delete user
```bash
docker exec -it socks5-proxy-server-proxy-1 sh -c 'exec node scripts/delete-user.js'
```### Show users statistics
```bash
docker exec -it socks5-proxy-server-proxy-1 sh -c 'exec node scripts/users-stats.js'
```## Telegram bot for administration
### Configuration
- Initialize bot at @botfather, get API token
- Set params in .env:
- PUBLIC_URL - URL to server. E.g. http://proxy.domain.com:8443
- TELEGRAM_API_TOKEN - API token from BotFather
- TELEGRAM_WEBHOOK_URL - default: /webhook
- TELEGRAM_USE_WEBHOOKS - 1 - use webhooks, 0 - use polling. To use webhooks you need to generate ssl certificates
- Create admin:
```bash
docker exec -it socks5-proxy-server-telegram_bot-1 sh -c 'exec node scripts/create-admin.js'
```You also can delete admin via script, if you need:
```bash
docker exec -it socks5-proxy-server-telegram_bot-1 sh -c 'exec node scripts/delete-admin.js'
```### Available commands
- `/users_stats` - show data usage statistics per user
- `/create_user` - create new proxy user
- `/delete_user` - delete proxy user
- `/get_users` - get list of proxy users
- `/generate_pass [length]` - generate random password with specified length (10 by default)