# How to Configure bannedbook/fanqiang: Complete V2Ray Server and Client Setup

> Learn to configure bannedbook/fanqiang for censorship circumvention. Follow this guide for a complete V2Ray server and client setup using provided config files and subscription links.

- Repository: [如何翻墙/fanqiang](https://github.com/bannedbook/fanqiang)
- Tags: how-to-guide
- Published: 2026-06-15

---

**The bannedbook/fanqiang repository provides a complete V2Ray-based censorship circumvention toolkit that requires deploying a server instance using the provided [`config.json`](https://github.com/bannedbook/fanqiang/blob/main/config.json) and [`nginx.conf`](https://github.com/bannedbook/fanqiang/blob/main/nginx.conf) files, then importing the generated subscription link into platform-specific clients like V2RayN or ClashX.**

The **bannedbook/fanqiang** repository is a curated collection of proxy-tool tutorials, configuration scripts, and ready-to-use packages designed to bypass internet censorship. It organizes resources by platform—Windows, macOS, Linux, Android, iOS, and routers—and supports multiple proxy technologies including V2Ray, Shadowsocks, SSR, and Brook. Configuring this repository involves setting up a central V2Ray server on a VPS and connecting clients through standardized subscription links.

## Server-Side Configuration

The core of the **fanqiang** configuration is a **V2Ray server** deployed on a VPS. The repository provides specific configuration files under the `v2ss/server-cfg/` directory to streamline this process.

### Provision a VPS

Begin by acquiring a virtual private server from any provider. The repository includes detailed purchasing guides in `v2ss/购买Vultr VPS图文教程.md` and `v2ss/V2ray官方一键安装脚本.md` that walk through Vultr and 搬瓦工 (Bandwagon) setup. Ensure you have root access and a clean Ubuntu or Debian installation.

### Install V2Ray Core

Install the official V2Ray binary using the installation script referenced in the repository:

```bash
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

```

This script installs the binary to `/usr/local/bin/v2ray` and creates the configuration directory at `/usr/local/etc/v2ray/`.

### Deploy the Server Configuration

The server configuration resides in [`v2ss/server-cfg/v2/config.json`](https://github.com/bannedbook/fanqiang/blob/main/v2ss/server-cfg/v2/config.json). Download this file to your server's configuration directory:

```bash
wget https://raw.githubusercontent.com/bannedbook/fanqiang/master/v2ss/server-cfg/v2/config.json -O /usr/local/etc/v2ray/config.json

```

The configuration file implements a **VMess** inbound protocol with TCP networking. Here is the essential structure:

```json
{
    "log": {"loglevel": "warning"},
    "routing": {
        "domainStrategy": "AsIs",
        "rules": [{"type":"field","ip":["geoip:private"],"outboundTag":"block"}]
    },
    "inbounds": [{
        "listen":"0.0.0.0","port":1234,"protocol":"vmess",
        "settings":{"clients":[{"id":"7966c347-b5f5-46a0-b720-ef2d76e1836a"}]},
        "streamSettings":{"network":"tcp"}
    }],
    "outbounds":[
        {"protocol":"freedom","tag":"direct"},
        {"protocol":"blackhole","tag":"block"}
    ]
}

```

**Critical:** Replace the default `id` in the `clients` array with a freshly generated UUID before starting the service.

### Configure NGINX Reverse Proxy

For internet-facing traffic, an **NGINX reverse-proxy** terminates TLS and forwards WebSocket connections to V2Ray. The repository provides a working configuration in [`v2ss/server-cfg/nginx.conf`](https://github.com/bannedbook/fanqiang/blob/main/v2ss/server-cfg/nginx.conf).

Deploy this configuration to enable the **TLS + WebSocket** deployment pattern:

```nginx
location /bannedbook {
    proxy_redirect off;
    proxy_pass http://127.0.0.1:10000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

```

This setup listens on HTTPS (port 443) and forwards WebSocket traffic to the V2Ray daemon listening on localhost port 10000.

### Enable Systemd Service

Ensure the V2Ray daemon starts on boot using the systemd service file located at `v2ss/server-cfg/v2ray.service`. Copy this file to `/etc/systemd/system/v2ray.service`:

```ini
[Unit]
Description=V2Ray Service
After=network.target nss-lookup.target

[Service]
User=nobody
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true
Environment=V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/
ExecStart=/usr/local/bin/v2ray -confdir /usr/local/etc/v2ray/
Restart=on-failure
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target

```

Enable and start the service:

```bash
systemctl enable v2ray
systemctl start v2ray

```

## Client Configuration

Once the server is operational, configure clients by importing a **subscription link**—a URL that expands to a list of V2Ray nodes.

### Windows: V2RayN

For Windows users, the repository guides setup using V2RayN ([`windows/V2RayN.md`](https://github.com/bannedbook/fanqiang/blob/main/windows/V2RayN.md)):

1. Download and extract the V2RayN client.
2. Navigate to **Subscription Settings** → **Add** and paste your server subscription URL.
3. Click **OK** to update the node list.
4. Right-click the tray icon and select **Auto-configure system proxy**.

### macOS: ClashX

macOS users should follow the [`macos/ClashX.md`](https://github.com/bannedbook/fanqiang/blob/main/macos/ClashX.md) guide:

1. Install ClashX and grant system extension permissions.
2. Import the subscription file via the **Config** menu.
3. Toggle the proxy mode to **Global** or **Rule-based** depending on your routing needs.

### Android: V2RayNG

Android configuration is documented in [`android/V2RayNG.md`](https://github.com/bannedbook/fanqiang/blob/main/android/V2RayNG.md):

1. Install V2RayNG from the releases page.
2. Tap the **+** icon and select **Import subscription from URL**.
3. Paste the subscription link and update the profile.
4. Select a node and tap the **V** icon to connect.

### iOS: Shadowrocket

iOS users must use Shadowrocket as detailed in [`ios/Shadowrocket.md`](https://github.com/bannedbook/fanqiang/blob/main/ios/Shadowrocket.md):

1. Open the app and tap the **+** button.
2. Select **Type** → **Subscribe** and enter the subscription URL.
3. Save the configuration and enable the VPN toggle.

## Advanced Deployment Patterns

The repository supports **TLS + WebSocket + CDN** configurations for environments where direct connections are blocked. This pattern is detailed in `v2ss/V2Ray之TLS+WebSocket翻墙方法.md`.

To implement this:

1. Configure V2Ray to use WebSocket transport instead of TCP.
2. Place the server behind Cloudflare or another CDN that supports WebSocket proxying.
3. Use the NGINX configuration to handle the WebSocket upgrade headers.

This setup masks traffic as standard HTTPS, making it resistant to deep packet inspection.

## Summary

- **bannedbook/fanqiang** organizes proxy tools by platform and technology, with V2Ray as the primary protocol.
- Server setup requires deploying [`v2ss/server-cfg/v2/config.json`](https://github.com/bannedbook/fanqiang/blob/main/v2ss/server-cfg/v2/config.json) and [`v2ss/server-cfg/nginx.conf`](https://github.com/bannedbook/fanqiang/blob/main/v2ss/server-cfg/nginx.conf) on a VPS with the systemd service enabled.
- The official V2Ray install script automates binary installation to `/usr/local/bin/v2ray`.
- Client access relies on subscription links imported into V2RayN (Windows), ClashX (macOS), V2RayNG (Android), or Shadowrocket (iOS).
- Helper scripts like [`v2ray_check.sh`](https://github.com/bannedbook/fanqiang/blob/main/v2ray_check.sh) and [`bench.sh`](https://github.com/bannedbook/fanqiang/blob/main/bench.sh) assist with server health monitoring.

## Frequently Asked Questions

### What is the bannedbook/fanqiang repository?

**bannedbook/fanqiang** is a GitHub repository containing tutorials, configuration files, and scripts for setting up proxy servers to circumvent internet censorship. It primarily focuses on V2Ray, Shadowsocks, and SSR technologies, providing specific guides for Windows, macOS, Linux, Android, iOS, and router platforms.

### Which protocol should I choose for the server configuration?

The repository recommends **V2Ray with VMess** and **TLS + WebSocket** for most users, as implemented in [`v2ss/server-cfg/v2/config.json`](https://github.com/bannedbook/fanqiang/blob/main/v2ss/server-cfg/v2/config.json). This combination provides strong encryption and can traverse restrictive firewalls. If V2Ray is blocked in your region, fallback tutorials for Shadowsocks and Brook are available in the respective platform directories.

### How do I update the server configuration after initial setup?

Modify the [`/usr/local/etc/v2ray/config.json`](https://github.com/bannedbook/fanqiang/blob/main//usr/local/etc/v2ray/config.json) file on your VPS, then reload the systemd service using `systemctl restart v2ray`. The repository includes [`v2ray_check.sh`](https://github.com/bannedbook/fanqiang/blob/main/v2ray_check.sh) for verifying service health after configuration changes. Always validate JSON syntax before restarting to prevent service failures.

### Can I configure bannedbook/fanqiang on a router?

Yes, the repository includes specific router configurations in [`router/OpenWRT.md`](https://github.com/bannedbook/fanqiang/blob/main/router/OpenWRT.md). OpenWRT users can install V2Ray or Shadowsocks clients directly on compatible routers, allowing all devices on the local network to share the proxy connection without individual client configuration. This approach is also compatible with game consoles like PS4 and PS5 as documented in the `game/` directory guides.