Pages

Tuesday, 3 January 2023

利用vpn2fly翻墙


vpn over v2ray disguised by wss, vpn is optional.

Why vpn2fly

  • minimal steps
    • one shot init: only domain is the necessary parameter
    • one shot deploy: they're all handled by docker dompose
    • one shot connect: qrcode / vmess-url / configs generated for client, no mannual config is needed
    • auto start after host rebooting
  • safe
    • certs are automatically generated and updated
    • secrets are auto-generated at init stage
    • disguise with three layer, hard to be detected by GFW
    • global proxy for all you APPs by using vpn

Prerequisites

  • vps with static ip, ports 80,443 are open, ports 1024,51820 are free
  • successfuly domain resolution to your vps
  • docker compose, dnsutils, qrencode

Server Side

  1. git clone https://github.com/dusmart/vpn2fly.git && cd vpn2fly
  2. bash init.sh ${YOUR-DOMAIN}
  3. docker compose up -d

see step by step tutorial on a purely new debian azure vm

Mobile Client

  • download any v2ray client to your phone
  • you can copy the vmess link at init stage, choose import from clipboard
  • you can also scan the qrcode generated at init stage

MacOS Client

  1. brew install v2ray
  2. copy the client.json generated on server to your mac, v2ray's config file is usually located at /opt/homebrew/etc/v2ray/config.json
  3. brew services start v2ray
  4. install the free wireguard in app store
  5. add the config in vpn2fly/wireguard/peer1/peer1.conf on server to client side

Windows Client

  1. download v2ray-core and extract, version must be lower than 5.0 such as 4.45.2
  2. copy the client.json generated on server to your v2ray-core folder
  3. v2ray.exe -config client.json. If it prompts An attempt was made to access a socket in a way forbidden by its access permiss, restart Internet Connection Sharing(ICS) in service.msc or use command net stop hns && net start hns , it may help you
  4. install the free wireguard
  5. add the config in vpn2fly/wireguard/peer1/peer1.conf on server to client side

Roadmap

  • Remove all mannual configs from macos VPN client
  • Add more client tutorial
    • free macOS client
    • free iOS client
    • free android client
    • free windows client
  • Add one command for macOS's system proxy quick switch, see v2rayx's switch code and install code here

Acknowledgments

Illustration for MacOS Client Usage

how to find v2ray's default config file location

  • brew services --json will show you a plist file for v2ray
  • cat ${v2ray.plist} will show you what's the command to start v2ray
  • see the ProgramArguments after -config, it is the config file that will be used

config the socks5 and http proxy for system proxy

  • find the proxy in your system proxy (search proxy in system settings)
  • set http and https proxy to 127.0.0.1:8002
  • set socks5 proxy to 127.0.0.1:1082


use vpn over v2ray

  • open/close the switch in wireguard or system settings are both OK


 from https://github.com/dusmart/vpn2fly

No comments:

Post a Comment