### Linux Installation Script with Specific Version and Local File Source: https://github.com/v2ray/manual/blob/master/ru/welcome/install.md Example of using the Linux installation script to install a specific version of V2Ray from a local zip file. ```bash ./go.sh --version v1.13 --local /path/to/v2ray.zip ``` -------------------------------- ### Linux Installation Script with Proxy Source: https://github.com/v2ray/manual/blob/master/ru/welcome/install.md Example of using the Linux installation script with a SOCKS5 proxy for downloading V2Ray packages. ```bash ./go.sh -p socks5://127.0.0.1:1080 ``` -------------------------------- ### V2Ray Installation Script Parameters (go.sh) Source: https://github.com/v2ray/manual/blob/master/vi/welcome/install.md The go.sh script supports several parameters to customize the installation process. These include specifying a proxy for downloads, forcing an installation, setting a specific version, or using a local package. ```bash # Install with SOCKS proxy ./go.sh -p socks5://127.0.0.1:1080 # Install a specific version from a local file ./go.sh --version v1.13 --local /path/to/v2ray.zip ``` -------------------------------- ### Linux Installation Script (go.sh) Source: https://github.com/v2ray/manual/blob/master/zh_cn/chapter_00/install.md This script automates the installation and update of V2Ray on Linux systems. It handles dependency installation (unzip, daemon), file placement, and service configuration for systems with Systemd or SysV init. ```bash bash <(curl -L -s https://install.direct/go.sh) ``` -------------------------------- ### Linux Installation Script Parameters Source: https://github.com/v2ray/manual/blob/master/zh_cn/chapter_00/install.md Customization options for the go.sh installation script, allowing users to specify proxy settings, force reinstallation, select specific versions, or use local installation files. ```bash # Using a SOCKS5 proxy to download and install the latest version: ./go.sh -p socks5://127.0.0.1:1080 # Forcing reinstallation of a specific version from a local file: ./go.sh --version v1.13 --local /path/to/v2ray.zip ``` -------------------------------- ### Install V2Ray on Linux using go.sh Source: https://github.com/v2ray/manual/blob/master/es/welcome/install.md This script downloads and installs V2Ray on Linux systems. It automatically detects existing installations for upgrades and handles the installation of necessary dependencies like unzip and systemd/daemon if available. The script configures V2Ray to run as a service. ```bash curl -Ls https://install.direct/go.sh | sudo bash ``` -------------------------------- ### V2Ray Linux Installation Script Parameters Source: https://github.com/v2ray/manual/blob/master/fa/welcome/install.md The go.sh script used for Linux installation supports several parameters to customize the download and installation process. These include specifying a proxy for downloads, forcing an installation, setting a specific version, or using a local package. ```bash # Install the latest package using SOCKS proxy 127.0.0.1:1080 ./go.sh -p socks5://127.0.0.1:1080 # Install version v1.13 from a local file ./go.sh --version v1.13 --local /path/to/v2ray.zip ``` -------------------------------- ### go.sh Installation Script Parameters Source: https://github.com/v2ray/manual/blob/master/es/welcome/install.md The `go.sh` script used for V2Ray installation supports several parameters to customize the download and installation process. These include specifying proxies, forcing a reinstallation, setting a specific version, and using local packages. ```APIDOC go.sh: -p, --proxy Use a proxy to download V2Ray packages. Example: "socks5://127.0.0.1:1080" or "http://127.0.0.1:3128". -f, --force Force installation. The script will assume V2Ray was not installed at all. --version The version to be installed. Example: "v1.13". Defaults to the latest stable release. --local Use a local package for installation. Examples: Install with SOCKS proxy: ./go.sh -p socks5://127.0.0.1:1080 Install specific version from local file: ./go.sh --version v1.13 --local /path/to/v2ray.zip ``` -------------------------------- ### V2Ray Configuration File Structure Source: https://github.com/v2ray/manual/blob/master/ru/welcome/install.md Illustrates the typical file paths where V2Ray components and configuration are installed on a Linux system after running the installation script. ```json /usr/bin/v2ray/v2ray: Исполняемый файл V2Ray /usr/bin/v2ray/v2ctl: Утилита управления /etc/v2ray/config.json: Файл с настройками /usr/bin/v2ray/geoip.dat: Файл с данными об IP /usr/bin/v2ray/geosite.dat: Файл с данными о доменах ``` -------------------------------- ### Install V2Ray on Linux using go.sh Source: https://github.com/v2ray/manual/blob/master/en/welcome/install.md This script downloads and installs V2Ray on Linux systems. It automatically detects existing installations for upgrades and handles dependencies like unzip and systemd/daemon if available. The script installs V2Ray to /usr/bin/v2ray and configures it as a service. ```bash curl -Ls https://install.direct/go.sh | sudo bash ``` -------------------------------- ### Install V2Ray on Linux using go.sh Source: https://github.com/v2ray/manual/blob/master/vi/welcome/install.md This command downloads and executes the V2Ray installation script for Linux. It handles the installation of V2Ray, v2ctl, configuration files, and data files. It also sets up V2Ray as a systemd or SysV service if available. ```bash curl -Ls https://install.direct/go.sh | sudo bash ``` -------------------------------- ### Install V2Ray on Linux using go.sh Source: https://github.com/v2ray/manual/blob/master/ko/welcome/install.md This script downloads and installs the latest V2Ray release on Linux systems. It handles dependencies like unzip and systemd/daemon, and configures V2Ray to run as a service. The script also manages upgrades and preserves existing configuration files. ```bash curl -Ls https://install.direct/go.sh | sudo bash ``` -------------------------------- ### go.sh Script Parameters for V2Ray Installation Source: https://github.com/v2ray/manual/blob/master/ko/welcome/install.md The go.sh script supports several parameters to customize the V2Ray installation process. These include specifying a proxy for downloads, forcing an installation, selecting a specific version, or using a local package file. ```bash # Install latest package using SOCKS proxy ./go.sh -p socks5://127.0.0.1:1080 # Install v1.13 from a local zip file ./go.sh --version v1.13 --local /path/to/v2ray.zip ``` -------------------------------- ### go.sh Script Parameters for V2Ray Installation Source: https://github.com/v2ray/manual/blob/master/en/welcome/install.md The `go.sh` script used for V2Ray installation supports several command-line parameters to customize the download and installation process. These include specifying proxies, forcing reinstallation, selecting a specific version, and using local package files. ```APIDOC go.sh: -p, --proxy Use a proxy to download V2Ray packages. Example: "socks5://127.0.0.1:1080" or "http://127.0.0.1:3128". -f, --force Force installation. The script will assume V2Ray was not installed at all. --version Specify the version to install, e.g., "v1.13". Defaults to the latest stable release. --local Use a local package file for installation. Examples: Install using SOCKS proxy: ./go.sh -p socks5://127.0.0.1:1080 Install a specific version from a local file: ./go.sh --version v1.13 --local /path/to/v2ray.zip ``` -------------------------------- ### Install Built Package Source: https://github.com/v2ray/manual/blob/master/zh_cn/developer/intro/compile.md Installs a locally built V2Ray package using a provided installation script. The script requires the path to the zip file of the built package. ```bash $GOPATH/src/v2ray.com/core/release/install-release.sh --local ``` -------------------------------- ### V2Ray Service Management (Systemd) Source: https://github.com/v2ray/manual/blob/master/zh_cn/chapter_00/install.md Commands to manage the V2Ray service on systems using Systemd, including starting, stopping, checking status, reloading, and restarting the V2Ray process. ```bash # Start V2Ray systemctl v2ray start # Stop V2Ray systemctl v2ray stop # Check V2Ray status systemctl v2ray status # Reload V2Ray configuration systemctl v2ray reload # Restart V2Ray systemctl v2ray restart ``` -------------------------------- ### Running V2Ray on Different Operating Systems Source: https://github.com/v2ray/manual/blob/master/fa/welcome/start.md Instructions for running the V2Ray process on Windows, macOS, and Linux. For Windows and macOS, simply execute the V2Ray binary. For Linux, it details running in the foreground with a specified config file or using systemd for background execution. ```bash # Windows and macOS: v2ray # Linux (foreground): v2ray --config=/etc/v2ray/config.json # Linux (background using systemd - conceptual): systemctl start v2ray ``` -------------------------------- ### Install V2Ray on Linux Source: https://github.com/v2ray/manual/blob/master/fa/welcome/install.md This bash script downloads and installs V2Ray on Linux systems. It handles detecting existing installations, updating, and setting up V2Ray as a service using systemd or SysV init if available. It also installs necessary data files like geoip.dat and geosite.dat. ```bash curl -Ls https://install.direct/go.sh | sudo bash ``` -------------------------------- ### Linux Installation Script Source: https://github.com/v2ray/manual/blob/master/ru/welcome/install.md This bash script downloads and installs V2Ray on Linux systems. It automatically detects and installs necessary dependencies like unzip and systemd/daemon if available. The script also handles updates and preserves existing configurations. It installs V2Ray binaries, configuration files, and geoIP/geosite data, and sets up V2Ray as a system service. ```bash curl -Ls https://install.direct/go.sh | sudo bash ``` -------------------------------- ### Migrating to fhs-install-v2ray Source: https://github.com/v2ray/manual/blob/master/zh_cn/chapter_00/install.md Steps to migrate from the older V2Ray installation script to the new fhs-install-v2ray script, including removing the old installation, moving configuration files, and executing the new script. ```bash # Remove old installation bash <(curl -L https://install.direct/go.sh) --remove rm -r /var/log/v2ray/ # Migrate configuration mv /etc/v2ray/ /usr/local/etc/ # Install using the new script bash <(curl https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) ``` -------------------------------- ### Automated Build from Source Source: https://github.com/v2ray/manual/blob/master/zh_cn/developer/intro/compile.md Provides steps for automated building of V2Ray from source code, including downloading, extracting, and building using Bazel. This is useful for creating installation sources or custom builds. ```bash cd $GOPATH/src/v2ray.com/core bazel build --action_env=GOPATH=$GOPATH --action_env=PATH=$PATH //release:v2ray_linux_amd64_package unzip bazel-bin/release/v2ray-linux-64.zip ``` -------------------------------- ### Verifying V2Ray Installation Package Source: https://github.com/v2ray/manual/blob/master/zh_cn/chapter_00/install.md Methods to verify the integrity of downloaded V2Ray installation packages using SHA checksums found in .dgst files or GPG signatures provided with the binaries. ```APIDOC Verification Methods: 1. SHA Sums: - Check the SHA1 or SHA256 digest of the zip file against the corresponding .dgst file. 2. GPG Signatures: - Verify the signature file (v2ray.sig or v2ray.exe.sig) using the official GPG public key. - Public key location: https://raw.githubusercontent.com/v2ray/v2ray-core/master/release/verify/official_release.asc ``` -------------------------------- ### V2Ray Docker Images Source: https://github.com/v2ray/manual/blob/master/zh_cn/chapter_00/install.md Information on available V2Ray Docker images from Docker Hub, including 'v2ray/official' for stable releases and 'v2ray/dev' for development builds. ```docker # Pull the official V2Ray image docker pull v2ray/official # Pull the development V2Ray image docker pull v2ray/dev ``` -------------------------------- ### Bazel Build All Packages Source: https://github.com/v2ray/manual/blob/master/zh_cn/developer/intro/compile.md Builds all available V2Ray installation packages using Bazel. This command triggers the build for all release targets defined in the Bazel build system. ```bash cd $GOPATH/src/v2ray.com/core bazel build --action_env=GOPATH=$GOPATH --action_env=PATH=$PATH //release:all ``` -------------------------------- ### V2Ray SysV Init Script Configuration Source: https://github.com/v2ray/manual/blob/master/ru/welcome/install.md Shows the default location for the V2Ray SysV init script on Linux systems. ```json /etc/init.d/v2ray ``` -------------------------------- ### V2Ray Server Configuration Source: https://github.com/v2ray/manual/blob/master/ru/welcome/start.md This JavaScript configuration sets up V2Ray as a server. It listens on port 10086 using the VMess protocol and accepts connections from clients with a matching ID. It forwards outbound traffic using the freedom protocol. ```javascript { "inbounds": [{ "port": 10086, // Port of the server. Должен быть таким же, как упомянутый выше. "protocol": "vmess", "settings": { "clients": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }] } }], "outbounds": [{ "protocol": "freedom", "settings": {} }] } ``` -------------------------------- ### V2Ray Docker Images Source: https://github.com/v2ray/manual/blob/master/vi/welcome/install.md V2Ray provides official Docker images for deployment. The 'official' image contains the stable release, while the 'dev' image includes the latest development code. Both images follow the same structure as the Linux installation. ```docker # Official V2Ray image docker pull v2ray/official # Development V2Ray image docker pull v2ray/dev ``` -------------------------------- ### V2Ray Client Configuration Source: https://github.com/v2ray/manual/blob/master/ru/welcome/start.md This JavaScript configuration sets up V2Ray as a client. It configures a SOCKS5 inbound proxy on port 1080 and an outbound connection to a V2Ray server using the VMess protocol. It also includes basic routing rules to direct private IP traffic directly. ```javascript { "inbounds": [{ "port": 1080, // Port of socks5 proxy. Настройте браузер на использование этого порта. "listen": "127.0.0.1", "protocol": "socks", "settings": { "udp": true } }], "outbounds": [{ "protocol": "vmess", "settings": { "vnext": [{ "address": "server", // Address of your V2Ray server. Может быть IP или доменным именем. "port": 10086, // Порт сервера V2Ray. "users": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }] }] } },{ "protocol": "freedom", "tag": "direct", "settings": {} }], "routing": { "domainStrategy": "IPOnDemand", "rules": [{ "type": "field", "ip": ["geoip:private"], "outboundTag": "direct" }] } } ``` -------------------------------- ### V2Ray Server Configuration Source: https://github.com/v2ray/manual/blob/master/en/welcome/start.md This JavaScript configuration sets up V2Ray as a server. It configures an inbound connection using the VMess protocol on port 10086, expecting clients with a specific user ID. An outbound connection using the Freedom protocol is also included. ```javascript { "inbounds": [{ "port": 10086, // Port of the server. Must be the same as above. "protocol": "vmess", "settings": { "clients": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }] } }], "outbounds": [{ "protocol": "freedom", "settings": {} }] } ``` -------------------------------- ### V2Ray Client Configuration Source: https://github.com/v2ray/manual/blob/master/es/welcome/start.md This JavaScript configuration sets up V2Ray as a client. It configures a SOCKS5 inbound proxy on port 1080 and an outbound connection to a V2Ray server using the VMess protocol. Routing rules are included to direct private IP traffic directly. ```javascript { "inbounds": [{ "port": 1080, // Port of socks5 proxy. Point your browser to use this port. "listen": "127.0.0.1", "protocol": "socks", "settings": { "udp": true } }], "outbounds": [{ "protocol": "vmess", "settings": { "vnext": [{ "address": "server", // Address of your V2Ray server. May be IP or domain address. "port": 10086, // Port of your V2Ray server. "users": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }] }] } },{ "protocol": "freedom", "tag": "direct", "settings": {} }], "routing": { "domainStrategy": "IPOnDemand", "rules": [{ "type": "field", "ip": ["geoip:private"], "outboundTag": "direct" }] } } ``` -------------------------------- ### V2Ray Client Configuration Source: https://github.com/v2ray/manual/blob/master/en/welcome/start.md This JavaScript configuration sets up V2Ray as a client. It configures a SOCKS5 inbound proxy on port 1080 and an outbound connection to a V2Ray server using the VMess protocol. Routing rules are included to direct private IP traffic directly. ```javascript { "inbounds": [{ "port": 1080, // Port of socks5 proxy. Point your browser to use this port. "listen": "127.0.0.1", "protocol": "socks", "settings": { "udp": true } }], "outbounds": [{ "protocol": "vmess", "settings": { "vnext": [{ "address": "server", // Address of your V2Ray server. May be IP or domain address. "port": 10086, // Port of your V2Ray server. "users": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }] }] } },{ "protocol": "freedom", "tag": "direct", "settings": {} }], "routing": { "domainStrategy": "IPOnDemand", "rules": [{ "type": "field", "ip": ["geoip:private"], "outboundTag": "direct" }] } } ``` -------------------------------- ### Pull V2Ray Source Code Source: https://github.com/v2ray/manual/blob/master/zh_cn/developer/intro/compile.md Fetches the V2Ray core source code using the go get command. Requires network access or a configured HTTP proxy for environments with restricted internet access. ```go go get -insecure -u v2ray.com/core/... ``` ```bash export http_proxy=http://localhost:1080 export https_proxy=http://localhost:1080 ``` -------------------------------- ### V2Ray Server Configuration Source: https://github.com/v2ray/manual/blob/master/es/welcome/start.md This JavaScript configuration sets up V2Ray as a server. It configures an inbound connection using the VMess protocol on port 10086, expecting clients with a specific user ID. An outbound connection using the 'freedom' protocol is also configured. ```javascript { "inbounds": [{ "port": 10086, // Port of the server. Must be the same as above. "protocol": "vmess", "settings": { "clients": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }] } }], "outbounds": [{ "protocol": "freedom", "settings": {} }] } ``` -------------------------------- ### V2Ray Server Configuration Source: https://github.com/v2ray/manual/blob/master/fa/welcome/start.md This JavaScript configuration defines V2Ray as a server. It listens on a specified port using the VMess protocol and requires a client ID for authentication. The outbound configuration directs all traffic to the 'freedom' protocol, allowing it to exit to the internet. ```javascript { "inbounds": [{ "پورت": 10086، // پورت سرور. باید همانند بالا باشد. "پروتکل": "vmess"، "تنظیمات": { "مشتری": [{"id": "b831381d-6324-4d53-ad4f-8cda48b30811"}] } }] خروجی: [ { "پروتکل": "آزادی"، "تنظیمات": {} }] } ``` -------------------------------- ### Install Git on Debian/Ubuntu Source: https://github.com/v2ray/manual/blob/master/eng_en/intro/compile.md Installs Git package on Debian-based systems using apt-get. ```bash sudo apt-get install git -y ``` -------------------------------- ### V2Ray Platform Support and Installation Source: https://github.com/v2ray/manual/blob/master/zh_cn/chapter_00/01_versions.md Information regarding V2Ray's platform support and installation procedures. This includes support for new operating systems, updates to installation scripts, and the inclusion of pre-compiled binaries. ```APIDOC Platform Support: - Added support for 32-bit MIPS (compiled with Golang 1.8). - Added support for FreeBSD. - Added OpenBSD binary files. Installation: - Executable files in the installation package are now GPG signed. - New wv2ray.exe in Windows installer runs without any interface. - Updated install-release.sh script: - Can now automatically stop V2Ray process and run it after update. - install-release.sh accepts --proxy parameter to download V2Ray from a specified proxy. - Updated installation script (install-release.sh) for automatic installation and updates on Debian / Ubuntu / CentOS 7. - Added some features to the installation script. ``` -------------------------------- ### V2Ray 실행 지침 Source: https://github.com/v2ray/manual/blob/master/ko/welcome/start.md Windows, macOS 및 Linux에서 V2Ray를 실행하는 방법에 대한 지침입니다. 구성 파일 위치와 실행 명령을 설명합니다. ```bash # Windows 및 macOS: # 구성 파일은 V2Ray 바이너리와 동일한 디렉토리에 있습니다. # 추가 매개 변수없이 'v2ray' 또는 'v2ray.exe'를 실행합니다. # Linux: # 구성 파일은 일반적으로 /etc/v2ray/config.json에 있습니다. # 전경 또는 배경 프로세스로 V2Ray를 실행하려면 'v2ray --config=/etc/v2ray/config.json'을 실행합니다. # systemd와 같은 다른 도구를 사용할 수도 있습니다. ``` -------------------------------- ### V2Ray 서버 구성 Source: https://github.com/v2ray/manual/blob/master/ko/welcome/start.md V2Ray를 서버로 실행하기 위한 샘플 서버 구성입니다. 클라이언트의 VMess 연결을 수신하고 트래픽을 직접 라우팅합니다. 클라이언트와 서버 간의 `id` 필드가 일치해야 합니다. ```javascript { "inbounds": [{ "port": 10086, // Port of the server. 위와 같아야합니다. "protocol": "vmess", "settings": { "clients": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }] } }], "outbounds": [{ "protocol": "freedom", "settings": {} }] } ``` -------------------------------- ### V2Ray 클라이언트 구성 Source: https://github.com/v2ray/manual/blob/master/ko/welcome/start.md PC 또는 모바일 장치에서 V2Ray를 실행하기 위한 샘플 클라이언트 구성입니다. SOCKS5 프록시를 설정하고 VMess 프로토콜을 사용하여 V2Ray 서버에 연결합니다. 이 구성은 IPOnDemand 도메인 전략을 사용하여 개인 IP 주소에 대한 트래픽을 직접 라우팅합니다. ```javascript { "inbounds": [{ "port": 1080, // Port of socks5 proxy. 이 포트를 사용하도록 브라우저를 지정하십시오. "listen": "127.0.0.1", "protocol": "socks", "settings": { "udp": true } }], "outbounds": [{ "protocol": "vmess", "settings": { "vnext": [{ "address": "server", // Address of your V2Ray server. IP 또는 도메인 주소 일 수 있습니다. "port": 10086, // Port of your V2Ray server. "users": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }] }] } },{ "protocol": "freedom", "tag": "direct", "settings": {} }], "routing": { "domainStrategy": "IPOnDemand", "rules": [{ "type": "field", "ip": ["geoip:private"], "outboundTag": "direct" }] } } ``` -------------------------------- ### V2Ray 충돌 로그 확인 Source: https://github.com/v2ray/manual/blob/master/ko/welcome/faq.md Linux 시스템에서 V2Ray 충돌 시 systemd를 사용하여 패닉 로그를 확인하는 방법입니다. systemd를 사용하지 않는 경우 일반적인 오류 정보를 확인하는 방법도 포함됩니다. ```bash journalctl -u v2ray v2ray -config = -test ``` -------------------------------- ### Basic JSON Object Example Source: https://github.com/v2ray/manual/blob/master/es/configuration/README.md Demonstrates a basic JSON object with various data types including string, number, boolean, array, and nested object. This serves as a fundamental example of JSON structure. ```javascript { "stringValue": "This is a string.", "numberValue": 42, "boolValue": true, "arrayValue": ["this", "is", "a", "string", "array"], "objectValue": { "another": "object" } } ``` -------------------------------- ### Go Code Formatting and Testing Source: https://github.com/v2ray/manual/blob/master/eng_en/intro/guide.md Commands to format Go code using `gofmt` and run tests, ensuring code quality and adherence to project standards before committing. ```Go gofmt -w v2ray.com/core/ go test v2ray.com/core/... ``` -------------------------------- ### Basic JSON Object Example Source: https://github.com/v2ray/manual/blob/master/zh_cn/chapter_02/README.md Demonstrates a simple JSON object with various data types including string, number, boolean, array, and nested object. This serves as a fundamental example for understanding JSON structure. ```javascript { "stringValue": "This is a string.", "numberValue": 42, "boolValue": true, "arrayValue": ["this", "is", "a", "string", "array"], "objectValue": { "another": "object" } } ``` -------------------------------- ### V2Ray Systemd Service Configuration Source: https://github.com/v2ray/manual/blob/master/ru/welcome/install.md Shows the default location for the V2Ray systemd service file on Linux systems. ```json /etc/systemd/system/v2ray.service ``` -------------------------------- ### Basic JSON Object Example Source: https://github.com/v2ray/manual/blob/master/ru/configuration/README.md Demonstrates a basic JSON object with various data types including string, number, boolean, array, and nested object. ```javascript { "stringValue": "This is a string.", "numberValue": 42, "boolValue": true, "arrayValue": ["this", "is", "a", "string", "array"], "objectValue": { "another": "object" } } ``` -------------------------------- ### Bazel Build for Specific Package Source: https://github.com/v2ray/manual/blob/master/zh_cn/developer/intro/compile.md Builds a V2Ray installation package for a specific platform (e.g., Linux AMD64) using Bazel. This command targets the release target for the desired package. ```bash cd $GOPATH/src/v2ray.com/core bazel build --action_env=GOPATH=$GOPATH --action_env=PATH=$PATH //release:v2ray_linux_amd64_package ``` -------------------------------- ### Manual Build V2Ray and V2CTL Source: https://github.com/v2ray/manual/blob/master/zh_cn/developer/intro/compile.md Compiles V2Ray and V2CTL executables manually using Go. This process generates the binaries in the user's home directory. It uses CGO_ENABLED=0 for cross-compilation and ldflags for stripping debug information. ```bash cd $(go env GOPATH)/src/v2ray.com/core/main env CGO_ENABLED=0 go build -o $HOME/v2ray -ldflags "-s -w" cd $(go env GOPATH)/src/v2ray.com/core/infra/control/main env CGO_ENABLED=0 go build -o $HOME/v2ctl -tags confonly -ldflags "-s -w" ``` -------------------------------- ### V2Ray Installation Script for Debian/Ubuntu Source: https://github.com/v2ray/manual/blob/master/eng_en/intro/compile.md Executes a shell script to automatically install Git, Go (version 1.9), compile V2Ray, and set up the GOPATH. ```bash bash <(curl -s https://raw.githubusercontent.com/v2ray/v2ray-core/master/release/install.sh) ``` -------------------------------- ### File Permission Adjustment for Certificates Source: https://github.com/v2ray/manual/blob/master/zh_cn/chapter_00/install.md Adjusts file permissions for V2Ray certificate files to ensure proper access, specifically changing the key file permission to 644 and potentially changing ownership to the 'nobody' user. ```bash # Change permission for the key file chmod 644 /srv/http/example.com.key # Change ownership (example for nobody:nogroup) chown -R nobody:nogroup /srv/http/ ``` -------------------------------- ### Transparent Proxy Setup with iptables Source: https://github.com/v2ray/manual/blob/master/zh_cn/chapter_02/protocols/dokodemo.md Provides example iptables commands to configure transparent proxying for Dokodemo-door. This includes setting up NAT and mangle rules to redirect TCP and UDP traffic to the Dokodemo-door listening port. ```bash # Create new chain iptables -t nat -N V2RAY iptables -t mangle -N V2RAY iptables -t mangle -N V2RAY_MARK # Ignore your V2Ray server's addresses # It's very IMPORTANT, just be careful. iptables -t nat -A V2RAY -d 123.123.123.123 -j RETURN # Ignore LANs and any other addresses you'd like to bypass the proxy # See Wikipedia and RFC5735 for full list of reserved networks. iptables -t nat -A V2RAY -d 0.0.0.0/8 -j RETURN iptables -t nat -A V2RAY -d 10.0.0.0/8 -j RETURN iptables -t nat -A V2RAY -d 127.0.0.0/8 -j RETURN iptables -t nat -A V2RAY -d 169.254.0.0/16 -j RETURN iptables -t nat -A V2RAY -d 172.16.0.0/12 -j RETURN iptables -t nat -A V2RAY -d 192.168.0.0/16 -j RETURN iptables -t nat -A V2RAY -d 224.0.0.0/4 -j RETURN iptables -t nat -A V2RAY -d 240.0.0.0/4 -j RETURN # Anything else should be redirected to Dokodemo-door's local port iptables -t nat -A V2RAY -p tcp -j REDIRECT --to-ports 12345 # Add any UDP rules ip route add local default dev lo table 100 ip rule add fwmark 1 lookup 100 iptables -t mangle -A V2RAY -p udp --dport 53 -j TPROXY --on-port 12345 --tproxy-mark 0x01/0x01 iptables -t mangle -A V2RAY_MARK -p udp --dport 53 -j MARK --set-mark 1 # Apply the rules iptables -t nat -A OUTPUT -p tcp -j V2RAY iptables -t mangle -A PREROUTING -j V2RAY iptables -t mangle -A OUTPUT -j V2RAY_MARK ``` -------------------------------- ### Download V2Ray Source and Build Binaries Source: https://github.com/v2ray/manual/blob/master/eng_en/intro/compile.md Downloads the V2Ray core source code using Go modules and then builds the 'v2ray' and 'v2ctl' executables. ```go go get -u v2ray.com/core/... go build -o $GOPATH/bin/v2ray v2ray.com/core/main go build -o $GOPATH/bin/v2ctl v2ray.com/core/infra/control/main ``` -------------------------------- ### Install Git and Go on Arch Linux Source: https://github.com/v2ray/manual/blob/master/eng_en/intro/compile.md Installs Git and Go packages on Arch Linux using pacman and sets the GOPATH environment variable. ```bash sudo pacman -S git sudo pacman -S go export GOPATH=$HOME/work ```