Skip to content

kawishkamd/Proxy_Change

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

V2Ray Proxy Manager

A Bash script to configure system-wide proxy settings for V2Ray on Linux. Supports separate HTTP and SOCKS5 proxies, auto-detects V2Ray ports from its config, and writes settings to both /etc/profile.d/proxy.sh and /etc/environment for maximum compatibility.

Features

  • V2Ray port auto-detection — reads http and socks inbound ports from /usr/local/share/v2ray/config.json (falls back to 10809/10808)
  • Separate HTTP and SOCKS5 proxy configuration
  • Port reachability test before applying settings
  • Dual-file writes/etc/profile.d/proxy.sh (login shells) and /etc/environment (display managers / PAM)
  • Safe backups — timestamped .bak files created before any modification
  • HTB-aware no_proxy — bypasses *.htb and *.local out of the box
  • Electron/Chromium compatibility flag included
  • Colored output for clear status feedback

Prerequisites

  • Linux (Debian/Ubuntu/Arch or any distro with /etc/environment)
  • bash
  • jq (for V2Ray config parsing)
  • Root privileges (sudo or run as root)

Installation

# Copy to system PATH
sudo cp proxy.sh /usr/local/bin/proxy
sudo chmod +x /usr/local/bin/proxy

Usage

sudo proxy

Menu Options

Choice Action
1 Custom — prompts for HTTP IP/port and SOCKS5 IP/port
2 Default — auto-detects V2Ray ports and applies immediately
3 Unset — removes all proxy settings from both files and current shell

Apply to Running Terminals

After setting, existing terminals need a manual source:

source /etc/profile.d/proxy.sh

New login sessions pick up settings automatically.

Files Modified

File Purpose
/etc/profile.d/proxy.sh Loaded by login shells (export statements)
/etc/environment Loaded by PAM / display managers (no export)

no_proxy Bypass List

The following are always excluded from proxying:

localhost, 127.0.0.1, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1, *.local, *.htb

About

Simple Proxy Setup on Debian-Based Linux.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages